Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting no read permission error despite...

Status
Not open for further replies.

planetdrouin

Technical User
Dec 29, 2001
36
US
Hello,

I am trying to implement code from here to check FE version and to update it if necessary.

The two threads for the code are faq705-2010 and faq705-1971 .

My problem is arising when I try to set the recordsets. I get a run time error 3112, which is 'records cannot be read; no read permission "TblVersionNumber"'. However, I am the owner of the table, and the entire database.

To open my FE, I use the following shortcut:

"C:\Programs\Microsoft Office\Office10\MSACCESS.EXE" "C:\NDR Software\NDR_App.mdb" /WRKGRP "C:\NDR Software\NDRSecurity.mdw"

The intial code to check the version is as follows:

Function CheckVersion() As Boolean
Dim Thisdb As DAO.Database, ThisRs As DAO.Recordset
Dim db As DAO.Database, Rs As DAO.Recordset
Set db = OpenDatabase("\\Server\Work\NDR Software\NDR_App.mdb")
'Path to master front end file in shared folder
Set Thisdb = CurrentDb
Set ThisRs = Thisdb.OpenRecordset("tblVersionNumber")
Set Rs = db.OpenRecordset("tblVersionNumber")
CheckVersion = False
If Rs(&quot;Version&quot;) <> ThisRs(&quot;version&quot;) Then
fHandleFile GetDBLocation & &quot;UpdateFrontEnd.vbs&quot;, WIN_NORMAL
CheckVersion = True
End If
Rs.Close
ThisRs.Close
Set Rs = Nothing
Set ThisRs = Nothing
If CheckVersion = True Then Application.Quit acQuitSaveNone
End Function

After my AutoExec halts, I am unable to change any of my VB as it says I don't have exclusive rights to the database. Anybody have any ideas on what I am doing wrong or is going on?

Thanks

Lawrence
 
It looks like you are opening the same database file 2 times and if you are in design mode you must be exclusive. If you need to refer to the database then use currentdb for all your recordsets.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top