Re: Object invalid or no longer set error involving database object. H

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Set RD.openrecordset(sSQL,dbOpenDynaset,dbSeeChanges)

Are you sure there isn't a typo in there? Is the equals sign missing between
the R and the D of RD? R is a recordset and D is a database, but there's no
RD variable declared or used in the code above that line. Do you have Option
Explicit declared at the top of every module?

dbSeeChanges doesn't cause that error. The RD object isn't valid because it
hasn't been set correctly before attempting to open the recordset. Looks
like you're trying to do both in the same line of code.

A module has limitations but you're nowhere near them.

The limits for a Jet 4 db are:

Max 1,024 characters per line.
Max 6,601 lines per procedure.
Max 65,545 lines per module.
Max 1,000 modules per database.

Chris
Microsoft MVP


rhc wrote:
im running access 2003 on xp. i have started seeing this bug in somve vba
routines where if I declare a dao database object then:
Set D = currentdb()
Set R = D.recordset(sSQL,dbOpenDynaset,dbSeeChanges)
loop through R updating rows.
R.close
Set RD.openrecordset(sSQL,dbOpenDynaset,dbSeeChanges)
Here I get the Object invalid or no longer set error. The database object D
seems to have become uninstantiated for no apparent reason. The only thing
that has changed recently in the code is the addition of the dbSeeChanges in
the recordset statements. I add these in to make the UI mdb the code is in
compatible with a sql server 2005 backend that im in the process of
developing. to be clear the above error happens wihen linked to the original
access mdb backend.
Could deSeeChanges cause this?
Is there a size limitation on the modules associated with forms? The ui mdb
as a lot of stuff in it but ithe file size is still only 12MB

Help!!!!

--
Message posted via http://www.accessmonster.com

.



Relevant Pages

  • Re: Trouble with DAO "SEEK" in converting application to SQL Express back end.
    ... but native Jet tables in the same MDB/MDE. ... you mean in the same MDB as referenced by the database object ... with which you created the recordset. ...
    (comp.databases.ms-access)
  • (no subject)
    ... - LDB locking which a persistent recordset connection fixes ... New format of Access 2000 MDB ... Place backend MDB on the root of the network share rather than several folders down ... Subdatasheets are a new feature in Access 2000 Therefore, you are more likely to notice this behaviour after you convert a database from an earlier version. ...
    (comp.databases.ms-access)
  • Re: recordset for a subform
    ... recordset or is dao.record different to the standard recordset? ... Did you declare it in a standard module? ... Allen Browne - Microsoft MVP. ... either method to work for a subform. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Using Recordset.State Property
    ... I may have multiple execution of procedure where Recordset is Set and Open. ... >> created class module for declare the recordset: ...
    (microsoft.public.access.formscoding)
  • Re: recordset for a subform
    ... Did you declare it in a standard module? ... Allen Browne - Microsoft MVP. ... either method to work for a subform. ... once the recordset has been loaded to the form i> should ...
    (microsoft.public.access.modulesdaovba)