Results 1 to 5 of 5
  1. #1
    jimneely is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Location
    Durham NC
    Posts
    5

    PHP ADO to ACCESS Database on server FATAL Error


    I am having trouble getting my php code to open my ACCESS Database on the server. I can open my ACCESS Database on my desktop. I can open the database on the server directly.
    I am getting FATAL Error "Uncaugth exception 'com_exception' , It is already open exclusively by another user or you need permission to view it's data"
    I have VBA code that gets text files from this server and it works fine.

    $conn
    = new COM("ADODB.Connection") or die("Cannot start ADO");

    $conn
    ->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=//S-fs2/Quality_bdc/_Daily Engineer Quality Report/Northwind.mdb");

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    It may be a permission issue with the ODBC's DNS. Or, if the Access file is an accdb and not an MDB like illustrated, it may be a trusted location issue. If you are opening the connection and not viewing a Windows' window, you may not see the trusted locations security prompt. Trusted locations are adjusted on each machine's registry that is attempting to open an Access file of version 2007 and later.

    You can adjust the registry manually, via code, or using a full version of Access on a given machine.

  3. #3
    jimneely is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Location
    Durham NC
    Posts
    5
    Quote Originally Posted by ItsMe View Post
    It may be a permission issue with the ODBC's DNS. Or, if the Access file is an accdb and not an MDB like illustrated, it may be a trusted location issue. If you are opening the connection and not viewing a Windows' window, you may not see the trusted locations security prompt. Trusted locations are adjusted on each machine's registry that is attempting to open an Access file of version 2007 and later.

    You can adjust the registry manually, via code, or using a full version of Access on a given machine.
    It is a mbd file. I have set the permissions on the file. I will have to read up on Trusted and Registry,, I am not sure what those terms are. Thanks for the direction.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    YOur profile says Access 2007 so I am making assumptions here.

    Maybe focusing on the ODBC connection first would be easier. Maybe you can try an older version of access with the existing setup to try and duplicate the symptom. As I look at your PHP I notice that you are using (what looks to me as) an older driver for the connection
    Microsoft.Jet.OLEDB.4.0

    Newer Access uses the Ace engine but I believe it still depends on the Jet engine for ODBC connections. Maybe there is a reference you can make in the DB to Jet engine. The whole "using Newer Access to create MDB file" is throwing me for a loop.

    Trusted locations started with Access 2007. I do not believe Trusted Locations is relevant using Access 2007 to open older file formats like MDB. You can adjust Macro settings using "Sandbox" mode. Now that I type this, I believe "Sandbox" mode is only available if the machine has Office 2003 (In other words, no way to create a registry Key where the necessary root key does not exist) installed so..... Maybe you can bypass security warnings on mdb files using Trusted Locations?????? (you are able to open DB from desktop machine with no security warnings???

    Here is a link that may help or may make things worse
    https://www.accessforums.net/securit...tml#post210517

  5. #5
    jimneely is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Location
    Durham NC
    Posts
    5
    Quote Originally Posted by ItsMe View Post
    YOur profile says Access 2007 so I am making assumptions here.

    Maybe focusing on the ODBC connection first would be easier. Maybe you can try an older version of access with the existing setup to try and duplicate the symptom. As I look at your PHP I notice that you are using (what looks to me as) an older driver for the connection
    Microsoft.Jet.OLEDB.4.0

    Newer Access uses the Ace engine but I believe it still depends on the Jet engine for ODBC connections. Maybe there is a reference you can make in the DB to Jet engine. The whole "using Newer Access to create MDB file" is throwing me for a loop.

    Trusted locations started with Access 2007. I do not believe Trusted Locations is relevant using Access 2007 to open older file formats like MDB. You can adjust Macro settings using "Sandbox" mode. Now that I type this, I believe "Sandbox" mode is only available if the machine has Office 2003 (In other words, no way to create a registry Key where the necessary root key does not exist) installed so..... Maybe you can bypass security warnings on mdb files using Trusted Locations?????? (you are able to open DB from desktop machine with no security warnings???

    Here is a link that may help or may make things worse
    https://www.accessforums.net/securit...tml#post210517
    Update::
    I tried to access a text file and given error that "Access Deny". I looked into the securities on the server folder and found my setting with full access, but noticed the domain account was restricted. So, I am thinking IT Admin has to give my PHP/HTML URL access on these server folders. I hope. In the mean time, I have made a copy of the access database and put it on my desktop. I will code to this until I get access to the server folders.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 08-13-2013, 09:35 PM
  2. Replies: 0
    Last Post: 06-05-2012, 12:28 AM
  3. Linking access database to tables in sql server is enough?
    By masoud_sedighy in forum SQL Server
    Replies: 6
    Last Post: 01-31-2012, 07:59 AM
  4. Import into SQL Server from Access Error
    By kaledev in forum Access
    Replies: 1
    Last Post: 02-16-2011, 03:43 PM
  5. Replies: 0
    Last Post: 03-09-2009, 12:20 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums