Visual Basic Programming Code Examples Visual Basic > ActiveX Controls Code Examples Calling ODBC from ADO to connect to thirdparty driver Calling ODBC from ADO to connect to thirdparty driver Dim ADOCN As New ADODB.Connection Dim ADORS As New ADODB.Recordset Dim mysql As String With ADOCN 'here how to call odbc from ADO! .ConnectionString = "DSN=odbc namet;UID=YOURUSERID;PWD=YOURPASSWORD;" .Mode = adModeReadOnly .Open End With With ADORS .CursorLocation = adUseClient .CursorType = adOpenKeyset .LockType = adLockOptimistic .ActiveConnection = ADOCN mysql = "select whatever from my table" .Source = mysql .Open 'for good preformance, I did store the record set in variant type variable so I can disconnect from host sooner .ctiveConnection = Nothing myrows = .RecordCount mycola = .Fields.Count mydata = .GetRows() 'now I can loop through my result