MikeR said:
Is it possible have 2 connections to a Jet DB at the same time?
Using either ADO or DAO in my Delphi app, I get a 'File in use' message.
Thanks, Mike
About the only thing I can think of is that the mdb file is in a directory
where users do not have file creating and deleting rights.
If access cannot open a "temp" working file in that same dir as the mdb
file, then the file is opened in exclusive, or perhaps read only mode.
Here is a standard windows script:
Set dbeng = CreateObject("DAO.DBEngine.36")
strMdbFile = "C:\Documents and Settings\Albert\My
Documents\Access\multiselect\MultiSelect.mdb"
Set db = dbeng.OpenDatabase(strMdbFile)
set rstContacts = db.OpenrecordSet("contacts")
rstContacts.MoveLast
msgbox "there is " & rstContacts.RecordCount & " records in the table
contacts"
rstContacts.Close
db.Close
The above can be pasted into a notepad, and then re-name the file extension
as .vbs
(you have to have file extensions turned on).
when you rename as ".vbs", you just created a windows script
Try then double clicking on this script. The code will halt at the msgbox
with the file open.
You can then try to launch another copy of the above script....
I would first test with a mdb file in know location such as:
c:\mytest\test.mdb
If you can run both scripts at the same time, then you able to have
process/programs open the
file at the same time.
If you cannot, then perhaps you are opening the file as exclusive?
note that the above script should run on any windows box 2000 and later even
with ms-access NOT having been installed since jet + dao comes with
windows.....
I would first check file permissions rights, and then check if somehow your
code is opening the file in excusive mode....