我是VBA的新手。当我尝试执行这段代码(由其他人编写)时,我在objMyconn.open
收到错误:
Dim objMyConn As ADODB.Connection
Dim objMyCmd As ADODB.Command
Set objMyConn = New ADODB.Connection
Set objMyCmd = New ADODB.Command
Set dependenciesRecordset = New ADODB.Recordset
dependenciesRecordset.CursorLocation = adUseClient
objMyConn.ConnectionString = "Provider=MSDASQL;Driver=SQL Server;Server=aac-
srvsqldb02\db02;Database=mydatabase;UID=webreport;PWD=abcdefghijkl;"
objMyConn.Open
答案 0 :(得分:0)
我假设驱动程序名称应介于{}之间:Driver={SQL Server}