Quote:
Originally posted by sunkal
Hi,
Wondering if you found out how the asnwer, as I am looking around for the ADO connection string and want to connect through ODBC.
|
Yes, I'm glad to share this, please see below;
Private Sub cmdOK_Click()
Dim cCmd As New ADODB.Command
Dim rsRow As New ADODB.Recordset
Dim cn As New ADODB.Connection
Dim connectstring As String
Dim strDB As String
Dim strServer As String
rem strDB = CStr(cboDatabase.Text)
rem strServer = CStr(cboServer.Text)
Rem connectstring = "Provider=Ifxoledbc; Data Source=database@server; user id=userid; password=password"
Rem connectstring = "Provider=MSDASQL; DRIVER = {IBM INFORMIX 3.82 32BIT}; SERVER=progen881; UID=userid; PWD=password"
connectstring = "Provider=MSDASQL; DSN=IDS881; DATABASE=yourDatabse; UID=yourUserid; PWD=YourPassword"
cn.Open (connectstring)
Set rsRow = cn.OpenSchema(adSchemaTables)
rsRow.MoveFirst
While (Not rsRow.EOF)
MsgBox rsRow.Fields(0) + " " + rsRow.Fields(1) + " " +
rsRow.Fields(2) + " " + rsRow.Fields(3)
rsRow.MoveNext
Wend
End Sub