Thread: Vb 6.0
View Single Post
Old 09-10-2006, 11:36 PM   #3 (permalink)
jorgebucaran
 
Newb Techie

Join Date: Sep 2006

Posts: 6

jorgebucaran

Default

Hello,

For good all times try this code.

Private connection As ADODB.Connection
Private recordset As ADODB.Recordset

Private Sub Form_Load()

Const dataBasePath As String = "C:\Program Files\Microsoft Visual Studio\VB98\BIBLIO.MDB"
'let's use the BIBLIO demo database provided with Vb, make sure the path is right.

Set connection = New ADODB.Connection
Set recordset = New ADODB.Recordset

connection.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & dataBasePath & ";"
connection.Open

recordset .Open "SELECT * FROM Authors", connection, adOpenDynamic

End Sub

Your recordset will be filled with the set of records from the Author's table of the database. You may want to check for the Recordset class' properties and methods to find more information on what you are trying to do. Good luck.
jorgebucaran is offline