un simple procedimiento o funcion llamada desde la macro autoexec debe hacer el truco: sub checksharedopen () on error goto checksharedopen_err dim db as database, strdb as string, hfile as integer set db = dbengine(0)(0) get file name of current database strdb = db.name hfile = freefile attempt to open database file, if opened exclusively then this will fail with an error open strdb for input access read shared as #hfile close #hfile checksharedopen_exit: exit sub checksharedopen_err: select case err case 70 persmission denied (share violation) msgbox "you are not allowed to open this database exclusively", 16 application.quit a_exit case else msgbox error, 16, "error #" & err & " in checksharedopen()" end select resume checksharedopen_exit end sub |