In my Word VBA application I would like to open an Access Database on a CD,
but get an error message telling me that it cannot be opened because it is
"either locked by another user or you need permission to read it". However,
none of these conditions are fulfilled as far as I undestand. If I copy the
database to the hard disk it works as expected. What fails is the following
line of code:

Set dbsDok = OpenDatabase(strDatabas)


What's the problem ?

/BosseH

Re: Cannot open Access database on CD by Jezebel

Jezebel
Tue Feb 01 15:19:48 CST 2005

The problem is that a file on CD is necessarily read-only, and your
instruction is trying to open the database for read/write. If you do it with
the file on your hard disk, you'll see that a new file appears in the same
folder -- same stem as the database file, with the extension .ldb -- this is
the lock file, to control multi-user access. With the file on CD, the system
is unable to create this lock file, so the open fails.





"Bo Hansson" <bo1.hansson@telia.com> wrote in message
news:%23OgUcsJCFHA.3376@TK2MSFTNGP12.phx.gbl...
> In my Word VBA application I would like to open an Access Database on a
> CD, but get an error message telling me that it cannot be opened because
> it is "either locked by another user or you need permission to read it".
> However, none of these conditions are fulfilled as far as I undestand. If
> I copy the database to the hard disk it works as expected. What fails is
> the following line of code:
>
> Set dbsDok = OpenDatabase(strDatabas)
>
>
> What's the problem ?
>
> /BosseH
>



Re: Cannot open Access database on CD by Bo

Bo
Tue Feb 01 15:57:39 CST 2005

Thank you - now it is obvious!


/BosseH


"Jezebel" <warcrimes@whitehouse.gov> skrev i meddelandet
news:uccPCPKCFHA.1404@TK2MSFTNGP11.phx.gbl...
> The problem is that a file on CD is necessarily read-only, and your
> instruction is trying to open the database for read/write. If you do it
> with the file on your hard disk, you'll see that a new file appears in the
> same folder -- same stem as the database file, with the extension .ldb --
> this is the lock file, to control multi-user access. With the file on CD,
> the system is unable to create this lock file, so the open fails.
>
>
>
>
>
> "Bo Hansson" <bo1.hansson@telia.com> wrote in message
> news:%23OgUcsJCFHA.3376@TK2MSFTNGP12.phx.gbl...
>> In my Word VBA application I would like to open an Access Database on a
>> CD, but get an error message telling me that it cannot be opened because
>> it is "either locked by another user or you need permission to read it".
>> However, none of these conditions are fulfilled as far as I undestand. If
>> I copy the database to the hard disk it works as expected. What fails is
>> the following line of code:
>>
>> Set dbsDok = OpenDatabase(strDatabas)
>>
>>
>> What's the problem ?
>>
>> /BosseH
>>
>
>