New coder, need help getting started - How do I set a ADO record set?

  • Thread starter news.east.cox.net
  • Start date
N

news.east.cox.net

I'm new to coding, took classes a few years back.

I would like to link an Access database to a form, using Access VB if
possible? I did this a few year back, but I'm having trouble now. Can any
one point me towards a good reference source.
How do I set up a ADO dataset to link to my database

I'm currently using Access2003.

I few years ago I completed a project (for class) in Access97 and or 2000.


Any help would be very grateful

Tony A.
 
S

Stefan Hoffmann

hi Tony,

news.east.cox.net said:
I would like to link an Access database to a form, using Access VB if
possible? I did this a few year back, but I'm having trouble now. Can any
one point me towards a good reference source.
How do I set up a ADO dataset to link to my database

Dim rs As ADODB.Recordset

Dim SQL As String

Set rs = New ADODB.Recordset
SQL = "SELECT * FROM yourTable"

rs.Open SQL, CurrentProject.Connection, _
adOpenForwardOnly, adLockOptimistic
Do While Not rs.EOF
' do something...
rs.MoveNext
Loop
rs.Close
Set rs = Nothing


mfG
--> stefan <--
 
M

Marc H

Maybe I missed something. When I use this syntax I get a message that I am
trying to use an undefined user type. Is there a pre-step where I set up
Access 2007 to see the ADO library?
 
S

Stefan Hoffmann

hi Marc,

Marc said:
Maybe I missed something. When I use this syntax I get a message that I am
trying to use an undefined user type. Is there a pre-step where I set up
Access 2007 to see the ADO library?
Check the references. There must be the ADO Library added.


mfG
--> stefan <--
 
D

Douglas J. Steele

Stefan Hoffmann said:
hi Marc,



Check the references. There must be the ADO Library added.

For the sake of completeness, the ADO Library will be Microsoft ActiveX Data
Objects 2.x Library, where x can range from 0 to 8.
 

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