Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Visual Basic Programming Code Examples

Visual Basic > ActiveX Controls Code Examples

Calling ODBC from ADO to connect to thirdparty driver

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
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