I'm getting Error 3051 with the following snippet of code. What I'm trying
to do is to open an update version on the server (ServerFile) to check it's
version number in a front-end table(VersionRe f) and compare it with the
version number of the LocalFile which has the same front-end table.
WorkgroupFileNa me is determined elsewhere. WorkgroupFileNa me, ServerFile
and LocalFile are all correct (I've stepped through the code to verify that
they are correct). The 3051, permissions error, occurs on the line indicated,
when trying to open the ServerFile.
Is using this method the correct way to open workgroup secured files. This
used to work fine, until I started using Access 2003. It still works fine
with A2K, but not A2003.
Set dbe = New PrivDBEngine
With dbe
' start Jet.
.SystemDB = WorkgroupFileNa me
.DefaultUser = "defaultadm in"
.DefaultPasswor d = "adminpwd"
' open workspace, database, recordset for Local File.
Set ws = .Workspaces(0)
Set db = ws.OpenDatabase (LocalFile)
Set rs = db.OpenRecordse t("SELECT * FROM VersionRef", dbOpenSnapshot)
LocalDBType = rs("DB_TYPE")
LocalVersion = rs("Version")
rs.Close
db.Close
' open workspace, database, recordset for Server File.
Set ws = .Workspaces(0)
Set db = ws.OpenDatabase (ServerFile)
'ERROR 3051 occurs on the following line.
Set rs = db.OpenRecordse t("SELECT * FROM VersionRef", dbOpenSnapshot)
FreshDBType = rs("DB_TYPE")
FreshVersion = rs("Version")
rs.Close
db.Close
End With
--
Message posted via http://www.accessmonster.com