ADO & local tables

G

Greg Franke

All of the examples that I have seen on hoe to use ADO/or ADOX seem to be
using an external ODBC driver (provider) or external MDB file.

Can anyone direct me to an example of how to use ADO or ADOX to access a
local table contained in the current project (MDB)?

Thanks!
 
D

Dave Patrick

Dim cnn As ADODB.Connection
Dim rs1 As ADODB.Recordset, rs2 As ADODB.Recordset
Dim strSQL1 As String, strSQL2 As String
Set cnn = CurrentProject.Connection
Set rs1 = New ADODB.Recordset
Set rs2 = New ADODB.Recordset
strSQL1 = "SELECT GroupID, description1, " _
& "description2, description3, description4, description5, " _
& "description6, description7, Comment, Control, Node, Selectable "
_
& "FROM lstDelays; "
rs1.Open strSQL1, cnn, adOpenDynamic, adLockOptimistic
rs1.MoveFirst
Do While rs1.EOF = False
'Do some stuff here
rs1.MoveNext
Loop
rs1.Close
cnn.Close


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| All of the examples that I have seen on hoe to use ADO/or ADOX seem to be
| using an external ODBC driver (provider) or external MDB file.
|
| Can anyone direct me to an example of how to use ADO or ADOX to access a
| local table contained in the current project (MDB)?
|
| Thanks!
|
|
 

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