Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 09-08-2006, 05:50 PM   #1 (permalink)
 
Newb Techie

Join Date: Jul 2006

Posts: 29

bat2ray

Unhappy Vb 6.0

hi,

I 'm actually want to learn how to connect my database to VB but i dont know how.i would only like to view what is in the database. can anyone help?
bat2ray is offline  
Old 09-09-2006, 04:32 AM   #2 (permalink)
 
Newb Techie

Join Date: Jul 2006

Posts: 34

The Future

Send a message via AIM to The Future
Default

You're gonna need to pick up a book on database programming in VB 6.0; there's a lot more to it than you may think. I learned the from Dummie's book, but any database book should teach you how. Good luck.
The Future is offline  
Old 09-10-2006, 11:36 PM   #3 (permalink)
 
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  
Old 09-13-2006, 03:15 PM   #4 (permalink)
 
Newb Techie

Join Date: Aug 2006

Posts: 6

ceejay187

Default

http://msdn.microsoft.com/msdnmag/issues/0600/web/
ceejay187 is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On