Article ID: 193128
Article Last Modified on 3/14/2005
Dim conn As ADODB.Connection
Dim strConn As String
' Assign the connection string to a variable.
strConn = "DRIVER={SQL Server};SERVER=;UID=;PWD=;DATABASE="
' Create the Connection object.
Set conn = New ADODB.Connection
'Assign the connection string and provider, then open the connection.
With conn
.ConnectionString = strConn
.Provider = "MSDASQL"
' Valid Enums for the ADO Prompt property are:
' adPromptAlways = 1
' adPromptComplete = 2
' adPromptCompleteRequired = 3
' adPromptNever =4
.Properties("Prompt") = adPromptAlways
.Open strConn
End With
Private Sub btnRunTest_Click()
Dim conn As New ADODB.Connection
Dim dl As New MSDASC.DataLinks
conn = dl.PromptNew
Debug.print conn.ConnectionString
End Sub
Additional query words: ADO ODBC OLEDB PROMPT DataLink
Keywords: kbhowto kbprovider kbdatabase KB193128