G
Guest
When I execute the following code, everything runs fine.
Dim wrk As DAO.Workspace
Dim db As DAO.Database
Dim dbNet As DAO.Database
Dim tdf As TableDef
Dim SourceFile As String
Dim LinkedTable As String
Dim CurrentPath As String
Dim prp As Property
Dim strName As String
Dim intPtr As Integer
Dim Path As String
Dim chrCurrentErrorVersion
Dim rs As DAO.Recordset
Dim strSourceFile As String
Dim strDestFile As String
Dim dapObject As AccessObject
Dim lngResult As String
Set wrk = CreateWorkspace("", "admin", "", dbUseJet)
Set dbNet =
wrk.OpenDatabase("\\Cpnvfs04\DEPTS\AccessFiles\Accuracy\AccuracyData.mdb")
Set rs = dbNet.OpenRecordset("tblDataUpdate", dbOpenDynaset)
Here is where I do some stuff…………
rs.Close
Set rs = Nothing
dbNet.Close
Set dbNet = Nothing
wrk.Close
Set wrk = Nothing
If I then try to make any changes to Forms, Reports, Modules etc. I get the
error message:
“Microsoft Access can’t save design changes or save to a new database object
because another user has the file open.â€
The file is on my “C†drive and I am the only one using it.
If I comment out the above lines, the rest of the code runs and I can make
any changes I want.
Can someone please show me how to open a database for a recordset and not
have this issue?
Thanks in advance.
Dim wrk As DAO.Workspace
Dim db As DAO.Database
Dim dbNet As DAO.Database
Dim tdf As TableDef
Dim SourceFile As String
Dim LinkedTable As String
Dim CurrentPath As String
Dim prp As Property
Dim strName As String
Dim intPtr As Integer
Dim Path As String
Dim chrCurrentErrorVersion
Dim rs As DAO.Recordset
Dim strSourceFile As String
Dim strDestFile As String
Dim dapObject As AccessObject
Dim lngResult As String
Set wrk = CreateWorkspace("", "admin", "", dbUseJet)
Set dbNet =
wrk.OpenDatabase("\\Cpnvfs04\DEPTS\AccessFiles\Accuracy\AccuracyData.mdb")
Set rs = dbNet.OpenRecordset("tblDataUpdate", dbOpenDynaset)
Here is where I do some stuff…………
rs.Close
Set rs = Nothing
dbNet.Close
Set dbNet = Nothing
wrk.Close
Set wrk = Nothing
If I then try to make any changes to Forms, Reports, Modules etc. I get the
error message:
“Microsoft Access can’t save design changes or save to a new database object
because another user has the file open.â€
The file is on my “C†drive and I am the only one using it.
If I comment out the above lines, the rest of the code runs and I can make
any changes I want.
Can someone please show me how to open a database for a recordset and not
have this issue?
Thanks in advance.