Re: Error 3265 mystery error



Solved it!

I had a procedure in which I was processing "special" tables in my database. In this procedure I was iterating through the records in one recordset and adding the records to a second recordset by iterating through the fields in the source recordset and updating the corresponding fields in the target recordset.

Dim objFld As ADODB.Field

'// We're ready to add a new Target recordset
Call rstTrg.AddNew
'// Iterate through each field in this recordset
For Each objFld In rstSrc.Fields
rstTrg.Fields(objFld.Name).Value = objFld.Value
Next objFld

Call rstTrg.Update

Notice that I was calling the Update method of the target recordset after setting all the field values in the row.
After processing one of these "special" tables, when I attempted to open a recordset from a different table, I got the 3265 error.

When I move the call to the Update method of the target recordset inside the Field iteration like the following:

For Each objFld In rstSrc.Fields
rstTrg.Fields(objFld.Name).Value = objFld.Value
Call rstTrg.Update
Next objFld

my 3265 errors go away, and my app runs happily through to the finish.

My guess is that either the former code block was somehow corrupting the database, or it was causing some other error that was not getting reported, but that caused a subsequent 3265 error -- sort of like how an unreported error 429 can cause a subsequent error 91 if code is allowed to resume after the 429 error.

Thank you all for your help.

- will f.


"will f" <null@xxxxxxxxxx> wrote in message news:ONk0jjSmGHA.4952@xxxxxxxxxxxxxxxxxxxxxxx
Greetings.

I'm getting an error 3265 (Item-not-found-in-the-collection type error) when I attempt to open a recordset in an Access 2000 database using adCmdTable. My code looks something like this:
Call MyRecordset.Open("tblTest", myConnection, adOpenKeyset, adLockOptimistic, adCmdTable)

The myConnection variable is an open ADODB connection object. "tblTest" is an existing table in the database. As a matter of fact, in the debug window I can use ADOX to confirm that there is a table named "tblTest" in the database. With ADOX, I can confirm that the table is there, and even iterate through the table's columns collection, etc.

Why would ADO give me an error 3265 when I try to open a recordset of the table, event when ADOX can confirm that it is there? Are there any known bugs with regard to this? Is there another error that's not getting caught by MS that's causing 3265 as a side-effect? Sometimes improperly handled errors can give rise to subsequent errors that are misleading.

Please help. Thank you.

- will f