CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2000
    Location
    Vancouver, BC, Canada
    Posts
    278

    how to connect to access?

    okay, I'm a SQL Server user, using an access database for a client's web project since the host does not support SQL Server. I have this error coming up:
    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.

    using an oledb connection like this one:
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & PathToDB

    I've also tried a DSN, but no luck....help!!!

    David Meikle
    Quantum Unit Solutions, LLC
    www.quantumunit.com

  2. #2
    Join Date
    Aug 2001
    Location
    India
    Posts
    173

    Re: how to connect to access?

    Check out that the database is opened, if opened close it.

    check out the driver also.

    Regards,
    Shivakumar G.M.


  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: how to connect to access?

    It does not matter if db is open. You can connect to the open database.

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  4. #4
    Join Date
    Sep 2001
    Posts
    16

    Re: how to connect to access?

    Hi,
    If the data base file is opened at the time of running of the program the above error will come. Try connecting to database through program by closing the data base file
    all the best
    sunil


  5. #5
    Join Date
    Feb 2001
    Posts
    54

    Re: how to connect to access?

    Hello:

    Is the table and database password and userid protected? You might need to get the password and userid to get in.

    Good Luck


  6. #6
    Join Date
    Mar 2000
    Location
    Vancouver, BC, Canada
    Posts
    278

    Re: how to connect to access?

    I am finding now that my connection string works (without changing it) if I do a simple:

    rs.open query, conn, adopenforwardonly, adlockreadonly

    but if I do a rs.open query,conn, adopenkeyset,adlockbatchoptimistic
    with a clientside cursor it gives me this error. I usually use this as a standard db method, since it allows me to use a global function:
    RetrieveRS(Query as string,optional PageSize as integer,optional PageNum as integer) as adodb.recordset

    that all of my methods can call to have it return a disconnected recordset so that the whole recordset is returned in one call to the database, rather than row by row.

    Can I not do this with access?



    David Meikle
    Quantum Unit Solutions, LLC
    www.quantumunit.com

  7. #7
    Join Date
    Oct 2001
    Posts
    3

    Re: how to connect to access?

    I find all freshmen here. All you need to do is a small change like this :
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & PathToDB & "'"

    good luck! Remember to give me some good comments .



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured