Unable to connect to an Access database

  • OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "North" returned message "The Microsoft Jet database engine cannot open the file 'C:\Practice Files\Northwind.mdb'. It is already opened exclusively by another user, or you need permission to view its data.".

    Msg 7303, Level 16, State 1, Line 1

    Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "North".

    Can anyone tell me what I need to do to resolve this, please?

  • Well, you have to make sure that the file "C:\Practice Files\Northwind.mdb" exists on the SERVER (and not on LOCAL machine) and the sql service account/windows account has read access to the file and it is not locked/opened by any other process.

    --Ramesh


  • you probably have it open in Access to look at the data at thesame time you are trying to access it via code:

    It is already opened exclusively by another user,

    you probably already fixed this, but simply close it from Access.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Can anyone tell me what I need to do to resolve this, please?

    Can you give some more info with your setup and circumstance!

    What is your connectionString?

    Do you have protocols enabled? Firewall? Required ports opened in your firewall for access to SQLEXPRESS? You got SQLBROWSER running?

  • Thanx Ramesh, but I don't know how to do this as Sql Server is on my local machine.

  • cbrassett (2/2/2009)


    Thanx Ramesh, but I don't know how to do this as Sql Server is on my local machine.

    1. Check if the file "C:\Practice Files\Northwind.mdb" exists on the location on your local machine

    2. Check the service account has permissions on the file (go to Run > type "services.msc")

    3. How did you create the linked server? If possible, can you post the script of the linked server (right click on server and select script > create new )

    --Ramesh


  • 1. Check if the file "C:\Practice Files\Northwind.mdb" exists on the location on your local machine

    This file is in this location

    2. Check the service account has permissions on the file (go to Run > type "services.msc")

    I receive a list with several sql options. I don't know which is the service account and how to find out what the permissions are.

    As you have probably guessed, I am not a seasoned programmer and am trying to learn from a training kit.

  • Can you re-create the linked server by using the following script?

    DECLARE @strLinkedServer NVARCHAR(100)

    SELECT @strLinkedServer = 'North'

    EXECUTE master.dbo.sp_dropserver

    @server = @strLinkedServer,

    @droplogins = 'droplogins'

    EXECUTE master.dbo.sp_addlinkedserver

    @server = @strLinkedServer,

    @provider = 'Microsoft.Jet.OLEDB.4.0',

    @srvproduct = 'OLE DB Provider for Jet',

    @datasrc = 'C:\Practice Files\Northwind.mdb'

    EXECUTE master.dbo.sp_addlinkedsrvlogin

    @rmtsrvname = @strLinkedServer,

    @useself = N'True',

    @locallogin = NULL,

    @rmtuser = NULL,

    @rmtpassword = NULL

    EXECUTE master.dbo.sp_addlinkedsrvlogin

    @rmtsrvname = @strLinkedServer,

    @useself = N'False',

    @locallogin = N'sa',

    @rmtuser = N'Admin',

    @rmtpassword = NULL

    --Ramesh


  • Well, it didn't display any error messages, so I suppose that it worked.

  • cbrassett (2/3/2009)


    Well, it didn't display any error messages, so I suppose that it worked.

    So, have you checked the linked server by accessing it?

    SELECT * FROM North...Orders

    --Ramesh


  • OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "North" returned message "The Microsoft Jet database engine cannot open the file 'C:\Practice Files\Northwind.mdb'. It is already opened exclusively by another user, or you need permission to view its data.".

    Msg 7303, Level 16, State 1, Line 1

    Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "North".

    This is the message I received

  • Do you see *.lock files in the directory "C:\Practice Files" when you running the linked server query? If so, then delete those files & try re-running the query.

    --Ramesh


  • EXECUTE sp_addlinkedserver 'North', 'OLE DB Provider for Jet',

    'Microsoft.Jet.OLEDB.4.0','C:\Practice Files\Northwind.mdb'

    Msg 15028, Level 16, State 1, Procedure sp_MSaddserver_internal, Line 89

    The server 'North' already exists.

    SELECT * FROM North...Customers

    OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "North" returned message "The Microsoft Jet database engine cannot open the file 'C:\Practice Files\Northwind.mdb'. It is already opened exclusively by another user, or you need permission to view its data.".

    Msg 7303, Level 16, State 1, Line 1

    Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "North".

    This is the sequence of commands queries and messages that I am getting

  • I think your Access database may be corrupted. Try downloading the Northwind database from Microsoft's web site

    http://www.microsoft.com/downloads/details.aspx?FamilyID=c6661372-8dbe-422b-8676-c632d66c529c&DisplayLang=en

    Although it's an Access 2000 database, you should still be able to link it and run queries on it.

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply