Re: Connection question
- From: "Jonathan" <KingsKnight1@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 5 Jul 2005 14:39:06 -0400
I coded the conn string as you have it (without the cursor location
property) and it opend the connection execlusive. But when I opened a
recordset using the connection, the record count property was -1.
How do I specify the cursor location propery in the connection string?
Thanks,
Jonathan
"Paul Clement" <UseAdddressAtEndofMessage@xxxxxxxxxxxxxx> wrote in message
news:0f7lc11uhf8924accq89i8ugi4celc5mjd@xxxxxxxxxx
> On Fri, 1 Jul 2005 12:37:32 -0400, "Jonathan"
<KingsKnight1@xxxxxxxxxxxxxxxxxx> wrote:
>
> ¤ Hello,
> ¤ I am opening up a connection to an MS-Access database this way
> ¤
> ¤ With cn
> ¤ .Provider = "Microsoft.Jet.oledb.4.0"
> ¤ .ConnectionString = strfile
> ¤ .CursorLocation = adUseClient
> ¤ .Mode = adModeShareExclusive
> ¤ .Open
> ¤ End With
> ¤
> ¤ The object being that I want the connection to fail if the database is
> ¤ already open by someone else. This does not seem to work if the database
has
> ¤ been opened read-only by another user.
> ¤
> ¤ So my question is, how do I open an exclusive connection such that:
> ¤ 1) Once I have it successfully, no one else will be able to open the
> ¤ database
> ¤ 2) If the database is already open, my connection will fail.
> ¤
> ¤ A related question: Even if my connection succeeds, is there a way to
know
> ¤ if anyone else has the database open?
>
> Try specifying the Mode in the connection string instead:
>
> strCnn = "Provider=Microsoft.Jet.oledb.4.0;" & _
> "Data Source=E:\My Documents\biblio.mdb;Mode=Share Exclusive"
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
.
- Follow-Ups:
- Re: Connection question
- From: Paul Clement
- Re: Connection question
- References:
- Connection question
- From: Jonathan
- Re: Connection question
- From: Paul Clement
- Connection question
- Prev by Date: Re: ADO Fails though compiled ActiveX DLL
- Next by Date: Question on recordset fields
- Previous by thread: Re: Connection question
- Next by thread: Re: Connection question
- Index(es):
Relevant Pages
|