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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordsets

Status
Not open for further replies.

darling

Programmer
Oct 25, 2001
14
0
0
GB
Hi

I am about to embark on my first real VB6 project. I need to create an Asset Register for PC’s using ADO. I have created an SQL database with three tables (Users, PC’s and Software).

What I would like to do is have a tab strip so that when someone selects a user from a combo box, the record set lists those users’ details (i.e. user info, PC info on the next tab and software info on the tab after that).

Also, if ‘ADD’ is selected from my menu, I would like to be able for the users to enter information into each tab strip to add a new record and that be saved in the database. This kind of thing is easy in Access but I’m a bit lost with VB.

I have my connection to the database set up and I have created a data environment with three commands, each listing all of the three table information (i.e. command1 lists all users, command2 lists all PC info and command3 lists all software info).

Any help, articles, sample code or apps, etc on performing this would be fantastic.

Thanks
Nora
 
mmmm usually i use the ADODC control, and bound the all the other controls to it, to add record on the dtabase is very simple..
just put an adodc control, and in the prperties set the connection and the recoursource (the table) and then put a textbox and on the datasource property write the name of the adodc and on the datafield, the field of the table you want there.
after you type there what you want to add, you just need a button that says
adodc.recordset.addnew
and thats it.

im not very familiar, with selecting from a combo and getting the details, what i would do, is taking the combo.text, and then make a select statement selecting all that you want from that one

"Select * from table where field= '" & combo.text & "'"

try to see the msn help for the adodc control, it will be very usefull..

i hope this helps you

Eli
 
Thanks for the reply.

I have the code sussed out for the combo box. The problem I'm having is that the when I add a new record for example, I want to update 3 tables. I want to add the user data to the user table on the user SStab, then the PC data on the PC SStab and so on.

I have only ever set up a data control on a table before and not more!

Thanks again for the help
Nora
 
mm im not sure im understanding, but what i would do, i use a data for each table, and then update the three of them.

i hope this helps

Eli
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top