P
Post Tenebras Lux
I have a split database, with tables in tbl.mdb and all code and queries in
front.mdb
I want to open recordsets (using DAO - because I'm only using Access, and
its way faster than ADO if I'm staying in Access - I've tested it) from each
database.
Dim sDbTBL as string, sDbFront as string
Dim dbTBL as DAO.Database, dbFront as DAO.Database
sDbTBL = CurrentProject.Path & "\" & "TBL.mdb"
Set DbFront = DBEngine(0)(0) ' I've also tried = CurrentDb()
Set dbTBL = OpenDatabase(sDbTBL)
'this works fine to here BUT if I try to make any changes to DbFront (which
is my front end and in which I'm writing the code), I get an error message:
"Microsoft Access can't save design changes or save to a new databse object
because another user has the file open. To save your desing changes or to
save to a new object, you must have exclusive access to the file."
The mdb is set to Shared, and I'm the only one using it (it's on my local
computer). It seems to be the reference to dbFront that causes this error.
I also get
"The database has been placed in a state by user <name> on machine <name>
that prevents it from being opened or locked. (Error 3734) "
I've tried the solution at http://www.source-code.biz/snippets/vbasic/10.htm
but doesn't solve the saving problem (though I don't get the Error 3734
message).
So, my question is - how do you have two open db references (using DAO),
where one of the references is to the MDB you are writing code in (FrontDb)
and still save new code?
All the questions I've seen around this don't seem to solve the problem.
Thanks, in advance.
front.mdb
I want to open recordsets (using DAO - because I'm only using Access, and
its way faster than ADO if I'm staying in Access - I've tested it) from each
database.
Dim sDbTBL as string, sDbFront as string
Dim dbTBL as DAO.Database, dbFront as DAO.Database
sDbTBL = CurrentProject.Path & "\" & "TBL.mdb"
Set DbFront = DBEngine(0)(0) ' I've also tried = CurrentDb()
Set dbTBL = OpenDatabase(sDbTBL)
'this works fine to here BUT if I try to make any changes to DbFront (which
is my front end and in which I'm writing the code), I get an error message:
"Microsoft Access can't save design changes or save to a new databse object
because another user has the file open. To save your desing changes or to
save to a new object, you must have exclusive access to the file."
The mdb is set to Shared, and I'm the only one using it (it's on my local
computer). It seems to be the reference to dbFront that causes this error.
I also get
"The database has been placed in a state by user <name> on machine <name>
that prevents it from being opened or locked. (Error 3734) "
I've tried the solution at http://www.source-code.biz/snippets/vbasic/10.htm
but doesn't solve the saving problem (though I don't get the Error 3734
message).
So, my question is - how do you have two open db references (using DAO),
where one of the references is to the MDB you are writing code in (FrontDb)
and still save new code?
All the questions I've seen around this don't seem to solve the problem.
Thanks, in advance.