Method Not Found

  • Thread starter Thread starter Dwight
  • Start date Start date
D

Dwight

I have an application that I recently updated which works
great on the version of Access it was developed on (Access
2000), but when it is ran on Access XP I get a compile
error (Method not found). It cannot find the "FindFirst"
method. I have checked the References to ensure that the
appropriate references are selected. The Microsoft 3.6
Object Library is selected.

Does anyone know what else the problem might be?

Thanks in advance!

Dwight
 
Usually this means that you think you are creating a DAO
recordset, but infact it is a ADO recordset. Try
explicitly declaring it as DAO.

Dim rs As DAO.Recordset

Chris Nebinger
 
Thank you!
Your response made me think to look at the order of the
preferences and found that DAO was at the bottom so I
moved it up in the priority. It is working now.

Dwight
 
Dwight,

That will work, but I don't think it is the best
approach. If someone tries to use an ADO recordset, finds
it fails because you have DAO listed higher, he might be
tempted to move ADO up. Also, it isn't clear which
recordset you want to use.

I highly recommend using DAO.Recordset instead.

Dim rs as DAO.Recordset
Dim fld as DAO.Field
Dim rst as ADODB.Recordset
Dim fl as ADODB.Field


Chris Nebinger
 
Back
Top