I have just gone through the long process of setting up a security file for an Access database. I need to do this because our office will be using sensitive data on laptops. I know it is not full proof but we need to cover our rear.
The problem I am having is that when using the Opendatabase method in dao I am getting a run time error 3033, permissions on the table that I am trying to open. It is basically just a linked table that uses the same workgroup security file as the front end. I have full rights to the database object and tables. The error seems to be at the db object level.
The strange thing is that if I hit 'refresh' after the error - the code is calling the opendatabase method at the last stage of my form's BEFORE UPDATE event. The refresh will clear it and allow the procedure to run. I can always access the linked tables.
Why would this just occur on the 1st call to the database and table? Then clear??
Here is a snippet of the code:
As you can see I've tried a couple of different methods to opening this table, from the simple CurrentDB to the more compelx dbengine and referencing the linked database and table.
Any suggestions would be helpful. I'm wondering if the security file may be corrupt only because it works on the 2nd attempt.
Dim dbs As DAO.Database, nextrec As Recordset, strSelect, NextNbr As String, dataname As String
Dim alreadyexists As Variant, NextInteger As Long
Dim ws As Workspace
DBEngine.SystemDB = "C:\dental sealant\DENTAL2.mdw"
DBEngine.DefaultUser = "dentaladmin"
DBEngine.DefaultPassword = "molar"
Set ws = DBEngine.Workspaces(0)
'Set dbs = CurrentDb
Set dbs = ws.OpenDatabase("C:\dental sealant\sealant_beLAP.mdb")
Set nextrec = dbs.OpenRecordset("tblClientSource", dbOpenDynaset, dbSeeChanges)
The problem I am having is that when using the Opendatabase method in dao I am getting a run time error 3033, permissions on the table that I am trying to open. It is basically just a linked table that uses the same workgroup security file as the front end. I have full rights to the database object and tables. The error seems to be at the db object level.
The strange thing is that if I hit 'refresh' after the error - the code is calling the opendatabase method at the last stage of my form's BEFORE UPDATE event. The refresh will clear it and allow the procedure to run. I can always access the linked tables.
Why would this just occur on the 1st call to the database and table? Then clear??
Here is a snippet of the code:
As you can see I've tried a couple of different methods to opening this table, from the simple CurrentDB to the more compelx dbengine and referencing the linked database and table.
Any suggestions would be helpful. I'm wondering if the security file may be corrupt only because it works on the 2nd attempt.
Dim dbs As DAO.Database, nextrec As Recordset, strSelect, NextNbr As String, dataname As String
Dim alreadyexists As Variant, NextInteger As Long
Dim ws As Workspace
DBEngine.SystemDB = "C:\dental sealant\DENTAL2.mdw"
DBEngine.DefaultUser = "dentaladmin"
DBEngine.DefaultPassword = "molar"
Set ws = DBEngine.Workspaces(0)
'Set dbs = CurrentDb
Set dbs = ws.OpenDatabase("C:\dental sealant\sealant_beLAP.mdb")
Set nextrec = dbs.OpenRecordset("tblClientSource", dbOpenDynaset, dbSeeChanges)