Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6/Access Database Basics

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I am absolutely new to VB so I have some basic questions. First of all, I have a Access2003 back end database and I want to create a program in VB6 to manipulate the data within it.

Do I have to open up a connection to a table in the backend database every time I open a form in the VB project to display the data? In my Access program I link the tables to the front end when I start the program. Do I have to link with the VB project as well then just populate the forms with data via queries or SQL?

Any help or shoves in the right direction is greatly appreciated. Thanks.
 
<Do I have to open up a connection to a table in the backend database every time I open a form in the VB project to display the data?

Sort of...you're on the right track. You open a connection to the entire database rather than to a table, then pull the data you need into a recordset. You can then either leave the connection open or close it, depending on the type of recordset that you're using. You'll want to learn the ins and outs of the different ADO recordset types; ADO recordsets are the bread and butter here. Now, keep in mind that you can open and close forms, and open and close recordsets, each independently of the other.

<Do I have to link with the VB project as well
No.
<then just populate the forms with data via queries or SQL?
Yes. :)

So, study ADO connections and ADO recordsets. These are the ones you need to pull and display data. To perform action queries, you'll want to investigate the ADO commands as well.

HTH

Bob
 
Check out the faq section of this forum and forum222.

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top