我在运行以下代码时遇到了一些麻烦,并且不知道为什么它不起作用:
VBS脚本:
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
错误弹出:
---------------------------
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
---------------------------
控制台输出:
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)
我已经安装了SQLServer2005向后兼容包。
任何想法都将不胜感激!