我是VBA的新手。任何人都可以帮助理解下面的DB连接字符串。
objMyConn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=Tracker;Data Source=GCHDB01;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False;"
此处的表名是什么?下面的一些代码。
objMyConn.Open
Set objMyCmd.ActiveConnection = objMyConn
objMyCmd.CommandText = "exec SGD_RPT_ACTIVITY_LEDGER " & "'" & Trim(inTACStartDate) & "', " & "'" & Trim(inTACEndDate) & "'"
答案 0 :(得分:0)
正如我之前所评论的,属性因提供商而异。 有一个我自己的Oracle 11 DB的例子,名为“GESTORES”:
Dim SQL_String As String
Dim dbConnectStr As String
Set con = New ADODB.Connection
Set recset = New ADODB.Recordset
Dim recordCount As Long
dbConnectStr = "Provider=msdaora;Data Source=" & "GESTORES; User Id=empresa2" & "; Password=" & "empresa2"
属性是自己解释的。