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!

Connecting & Disconnecting the ADO control 1

Status
Not open for further replies.

bdavis96

Programmer
Feb 11, 2002
97
0
0
US
What I would like to do is use one ado control (adoVacation) to connect to 3 different tables (same database), but I don't know the code to disconnect the ado control from each table.

Ex:

adoVacation.ConnectionString = "Provider=Microsoft.Je.OLEDB.4.0;" & "Persist Security Info=False;" & "Data Source=Vacation.mdb"

adoVacation.RecordSource = "Select * From tblVacation"

'Set objects (textboxes and whatnot) to DataField {I know how to do}

'Manipulate data {I know how to do}

'Disconnect from tblVacation, along with breaking the connection to each object I used to connect to {Need code}

When I connect to tblEmployee, do I need to do just the RecordSource code, or do I also need to add the code again for the Connect part to reconnect it to the database?

Thank you ahead of time for all your help.


 
Just change the recordsource string:
adoVacation.RecordSource = "Select * From tblEmployee"
adoVacation.Refresh Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Thank you very much johnwm, that was what I was looking for. Sorry it took me a little while to respond back to you. I marked your post as helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top