[AccessD] ADO - 424 error

Roz Clarke roz.clarke at donnslaw.co.uk
Tue Aug 9 03:18:40 CDT 2005


You star

I knew it had to be something simple :/

I will blame my stupidity on the flu - thank you, and thanks to Charlotte
and Gustav for your attempts to help also.

Roz

-----Original Message-----
From: Paul Hartland (ISHARP) [mailto:paul.hartland at isharp.co.uk] 
Sent: 09 August 2005 07:54
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] ADO - 424 error


Should there be an _ in the rs variable

Dim rs_ReqList As ADODB.Recordset 'temp requests list for filtering rs_Req
rsReqList.Open strSQL, cnn, adOpenDynamic, adLockOptimistic, adCmdTable 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: 08 August 2005 18:01
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] ADO - 424 error

Hi Roz

Try this:

  rsReqList.Open strSQL, cnn, adOpenKeyset, adLockOptimistic

or

  rsReqList.Open "tblTemp_AddDelegates", cnn, adOpenKeyset,
adLockOptimistic, adCmdTable

And, as Charlotte suggests, use .Execute ...

/gustav


>>> roz.clarke at donnslaw.co.uk 08/08 6:31 pm >>>
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
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-------------- next part --------------

The contents of this message and any attachments are the property of Donns Solicitors 
and are intended for the confidential use of the named recipient only.  They may be legally
 privileged and should not be communicated to, or relied upon, by any other party without 
our written consent.  If you are not the addressee, please notify us immediately so that we 
can make arrangements for its return.  You should not show this e-mail to any person or
 take copies as you may be committing a criminal or civil offence for which you may be
 liable.  The statement and opinions expressed in this e-mail message are those of the 
writer, and do not necessarily represent that of Donns Solicitors.  Although any files attached
 to this e-mail will have been checked with virus protection software prior to transmission, 
you should carry out your own virus check before opening any attachment.  
Donns Solicitors does not accept any liability for any damage or loss which may be caused 
by software viruses...


More information about the AccessD mailing list