ADO need help with this assignment? Help.

R

RON

OK I need your help, I need to do this assignment for a class and am getting
nowhere with it.

I need to use ADO to display information on a form from the current database
and another database.

I need to make a Form with Student info that will be filled into text boxes
from the STUDENT table of the current database. For example txtname,
txtaddress, txtzip would all get filled in from the STUDENTS Table.

On this same form I need a couple textboxes for example
txtcontactPersonName, txtContactPersonPhone <-- these will be filled in
using ADO from another databases CONTACTS Table. In the Contacts table of
the other Database, it has a corresponding StudentID to a corresponding
StudentID in the STUDENTS table of this database.

So for example If I wanted to make a NEXT RECORD BUTTON to show me all of
these values in a table, how would I code using ADO for this?

thanks for any help
 
A

AccessVandal via AccessMonster.com

Hi RON,

Ok, here is something for you to start with.

Dim Conn As ADODB.Connection
Dim rs As ADODB.Recordset

Set Conn = New ADODB.Connection
Set rs = New ADODB.Recordset

Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.Open "F:\YourFolder\Your.mdb", "admin", ""

rs.Open "tblContacts", Conn, adOpenStatic, adLockOptimistic

With rs
Do While Not rs.EOF
Debug.Print rs!FirstName
rs.MoveNext
Loop
End With

rs.Close
Conn.Close
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top