[AccessD] ADO - 424 error

Charlotte Foust cfoust at infostatsystems.com
Mon Aug 8 11:50:32 CDT 2005


What happens if you simply execute the DELETE SQL on the connection
instead of reverting to DAO to RunSQL?  Does that make a difference?  I
would expect the Open statement to need an adCmdText if you are passing
in a SQL string rather than a table name.  And is the table local or
linked?

Charlotte Foust


-----Original Message-----
From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk] 
Sent: Monday, August 08, 2005 9:32 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] ADO - 424 error


Hi all

I am getting a 424 error (object required) at the line in the code below
which opens an ADO recordset:

    Dim cnn As New ADODB.Connection
    Dim rs_ReqList As ADODB.Recordset 'temp requests list for filtering
rs_Req
    Dim strSQL As String

    Set cnn = CurrentProject.Connection
    Set rs_ReqList = New ADODB.Recordset

    DoCmd.RunSQL "DELETE FROM tblTemp_AddDelegates"

    strSQL = "SELECT * from tblTemp_AddDelegates"
    rsReqList.Open strSQL, cnn, adOpenDynamic, adLockOptimistic,
adCmdTable


In my experience, a 424 error is usually associated with a missing
reference, however my ADO reference is fine and I can open other
recordsets.

It fails the same way if I pass the table name in instead of using a SQL
string.

I have identical code running in another database (different table
obviously) that works fine, and the fact that the table is empty
shouldn't cause a problem...

Anyone got any ideas? It looks so simple I can't believe it's not
working 
/em bangs head on table

TIA

Roz



More information about the AccessD mailing list