Using this Code that tlbroadbent wrote about a year ago here..
Function OpenDatabaseExclusive()
Dim AccPath As String, rc As Double, dbPath As String
Dim db As DAO.Database
Set db = CurrentDb
dbPath = db.Name
db.Close
AccPath = SysCmd(acSysCmdAccessDir) & "msaccess.exe "
rc = Shell(AccPath & dbPath & " /excl", vbNormalFocus)
Quit
End Function
I put this as a module function that runs in my autoexec macro to ensure that the database is only opened in Exlcusive mode. However, while I'm sure it would work if the database name contained no spaces, it doesn't work with my current database name like "my database.mdb" ... it gives me the error "unable to locate the database "my.mdb" ...
Any ideas on how to change the code so the entire database name gets kicked into gear? Thanks much!
-Happen609
These things take time...
Function OpenDatabaseExclusive()
Dim AccPath As String, rc As Double, dbPath As String
Dim db As DAO.Database
Set db = CurrentDb
dbPath = db.Name
db.Close
AccPath = SysCmd(acSysCmdAccessDir) & "msaccess.exe "
rc = Shell(AccPath & dbPath & " /excl", vbNormalFocus)
Quit
End Function
I put this as a module function that runs in my autoexec macro to ensure that the database is only opened in Exlcusive mode. However, while I'm sure it would work if the database name contained no spaces, it doesn't work with my current database name like "my database.mdb" ... it gives me the error "unable to locate the database "my.mdb" ...
Any ideas on how to change the code so the entire database name gets kicked into gear? Thanks much!
-Happen609
These things take time...