Problem with ADP

J

Jeff

Hi,
I have just upsized my Access MDB to ADP. The following lines work well in
MDB but get an error in ADP.

Dim dbObject As DAO.Database
Dim rstObject As DAO.Recordset
Set dbObject = CurrentDB
Set rstObject = dbObject.OpenRecordset(“MyTableâ€)
With rstObject
………
End With

I know I have to use ADO instead of DAO, Can anyone tell me how to re-write
these codes? Thanks
 
V

Vayse

Just started on an ADP project myself.

Here's what I used:


Dim stSQL As String
Dim rsProcess As ADODB.Recordset
Dim cnnADO As ADODB.Connection

Set cnnADO = CurrentProject.Connection
Set rsProcess = New ADODB.Recordset

stSQL = "SELECT * FROM Process"
rsProcess.Open stSQL, cnnADO, adOpenDynamic, adLockOptimistic


The main thing for ADO is that you need to have a connection.
Hope this helps
Diarmuid
 

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