Access 2007 - upgrade problem

G

Gordon

I have converted my Access 2003 database to 2007, but when I try to
compile the code now, I get an error "Method or data member not found"
with the word "edit" highlighted in the following piece of code:


Private Sub cmdImportTracks_Click()
Dim db As DAO.Database, rs As Recordset, lintkount As Integer
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblCutsTemp")

lintkount = 1
Do While Not rs.EOF
rs.Edit
rs!fldTrackNo = FORMAT(lintkount, "##") ' formats like A 1,A
2...A10
rs.Update
lintkount = lintkount + 1
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set db = Nothing

End Sub

I had no problems with this in Access 2003 - can anyone suggest what
is causing this?

Thanks

Gordon
 
A

Allen Browne

1. Make sure the folder where your database resides is a trusted folder:
Office Button | Access Options | Trust Center | Trust Center Settings.

2. Check your library references:
http://allenbrowne.com/ser-38.html
Make sure none are missing, and you have the DAO one chosen.

3. Be explicit about the library you want, i.e. change the first line to:
Dim db As DAO.Database, rs As DAO.Recordset, lintkount As Integer

4. Try editing tblCutsTemp directly.
Do you have the priviliges (Access and Windows)?
 
G

Gordon

Hello Allen,

Thanks for the superfast response. Database is "trusted" and no
"missing" references indicated but there were a few pieces of code
which did not explicitly reference DAO (as in the sample code I
listed). Fixing those has solved the problem. But on reading your
web article on references I noticed that though I have DAO360.dll
registered, there is no reference to acedao.dll which your guide
indicates is necessary fro Access 2007.

I followed the written advice and tried to register this using
regsvr32 (even unregistering and re-registering) but to no avail. All
I get when running regsvr32 is a message saying "...acedao.dll was
loaded but the DllRegisterServer entry point was not
found. ......acedao.dll does not appear to be a .dll or .ocx file".

Have I got other problems yet to be found in my converted database? I
have to confess I have not yet fully tested the "converted" database
for all its functionality. I am working my way through it !!!

I have to admit also I am finding Access 2007 a steep learning curve
<sigh>.


Gordon
 
A

Allen Browne

Hi Gordon

In Access 2007, the DAO library refers to ACDDAO.DLL if you use the new file
format (ACCDB.) But if you open an MDB in Access 2007, the DAO library
refers to DAO360.DLL (i.e. the same library as the previous 3 versions did.)
You can verify this, by opening the Immediate Window (Ctrl+G), and entering:
? References("DAO").FullPath

Therefore if your file is an MDB, you have the right reference.

Have updated the web page to make that clearer.
 
G

Gordon

Hi Allen,

My converted database is (now) an accdb file. Running the ?
References("DAO").FullPath in the immediate window brought up the
ACEDAO.DLL path reference. <sigh of relief>.

Thanks for the clarification.


Gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top