Re: Connection question

Tech-Archive recommends: Fix windows errors by optimizing your registry



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)



.



Relevant Pages

  • Re: Changing Connection String programmatically
    ... Connection strings of different years can be stored in app.config ... is declared in MyDataset.Designer.cs as private, ... every year we will create new database. ... If you are storing connnection string information related to additional ...
    (microsoft.public.sqlserver.connect)
  • Send Form results to database error
    ... ' Send results to the database. ... ' myConnString = Connection string to database. ... ' myConnection = The database connection object. ...
    (microsoft.public.access.forms)
  • Re: User count
    ... Dim colUsers as New Collection ... Dim sCompName as string ... or back it up, or something, then take a look at the use of the "Connection ... Create a table in the front-end database, ...
    (microsoft.public.access.formscoding)
  • Re: [VW 7.3.1] ODBCConnection
    ... I played around with a few combinations on the connection string and ... with a trusted SQL Server connection. ... there are differences for database connects. ... > any database specific odbc drivers. ...
    (comp.lang.smalltalk)
  • Re: Installer - Custom Textboxes in UI problem
    ... > void Install function. ... I've tested it by writing the string out to a text ... > intended, a ADO.Net Connection String. ... > throw new InstallException("The database conection information is not ...
    (microsoft.public.dotnet.languages.csharp)