Visual Basic > ActiveX Controls
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
Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows