I'm having a bit of trouble getting the following piece of code running and am at a loss as to why it isn't working:
VBS Script:
On Error Resume Next
WScript.StdOut.WriteLine("Start")
Dim oServer
Set oServer = CreateObject("SQLDMO.SQLServer")
oServer.LoginSecure = True
oServer.Connect "(local)"
If (Err.number <> 0) Then
WScript.StdOut.WriteLine "Failed to connect to server (" & Err.number & ")"
Err.Clear
WScript.Quit(-1)
End If
Error Popup:
---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Runtime Error!
Program: C:\Windows\system32\cscript.exe
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.
---------------------------
OK
---------------------------
Console Output:
C:\Users\mryan\Documents\Code\script>cscript tfes_migrate.vbs
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Start
Failed to connect to server (424)
I have installed the SQLServer2005 Backwards compatibility pack.
Any ideas would be appreciated!