The nearest ADO equivalent to the code you wrote is:
Dim cnn as ADODB.Connection
Dim rs as ADODB.Recordset
Dim lngAffected as Long
Set cnn = CurrentProject.Connection
Set rs = cnn.Execute(strSQL, lngAffected, adCmdText)
'To open a table without SQL use
Set rs = cnn.Execute(strTablename, lngAffected, adCmdTableDirect)
But recordsets created in that way are read-only.
To create an updatable recordset use:
Set rst = New ADODB.Recordset
rst.Open "MyTable", cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect
or
rst.Open strSQL, cnn, adOpenKeyset, adLockOptimistic, adCmdText
HTH,
Ian.
"David C. Barber" <da***@NOSPAMdbarber.com> wrote in message
news:Fo********************@comcast.com...
I've upsized an Access 2000 MDB to an ADP and changed the tables from a
linked Access Backend to SQL Server. Now I'm told I can't use DAO any
more
and need to convert to ADO. While I've used ADO in VB6, there I created
my
connection object and had easy access to it. All I want to know is how do
I
convert:
Dim db as DAO.Database
Dim rs as DAO.Recordset
Set db = currentdb
Set rs = db.Open ...
To equivalent ADO code. Is there a built-in connection object I can use?
Thanks!
*David*