Permissions error trying to open MDB file with ODBC : PHP
This is a discussion on Permissions error trying to open MDB file with ODBC within the PHP forums in Programming Languages category; Using ODBC in a PHP script, I'm trying to read an MS Access MDB file that resides on another computer on my LAN. I'm getting the error: Warning: odbc_connect() [function.odbc-connect]: SQL error: [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., SQL state S1000 in SQLConnect in ... The file is NOT already opened exclusively (or in any other manner) by another user. I have set every "permission" that I can think of to allow access to the MDB ...
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| that resides on another computer on my LAN. I'm getting the error: Warning: odbc_connect() [function.odbc-connect]: SQL error: [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., SQL state S1000 in SQLConnect in ... The file is NOT already opened exclusively (or in any other manner) by another user. I have set every "permission" that I can think of to allow access to the MDB file. I have set the sharing/security on the folder where the MDB file is to allow "everyone" full control. One thing that showed up on a Google search taked about setting the "default open mode" in the database itself to "shared". I've done that - it made no difference. Another thread I found dealt with this exact same problem but the issue was never resolved - the guy said he was going to give up and move the MDB file to the server! Surely there must be a way around this. If it matters, I'm using PHP 5.2. I've tried it on two different server set-ups: one with WinXP Pro using IIS and the other Win2K using Apache. In both cases, the MDB file is on a computer running WinXP Pro. Any suggestions will be greatly appreciated. Thanks. |
|
#2
| |||
| |||
| On Fri, 21 Mar 2008 12:54:42 -0500, Jerry Stuckle <jstucklex@attglobal.net> wrote: >Martin wrote: >> Using ODBC in a PHP script, I'm trying to read an MS Access MDB file >> that resides on another computer on my LAN. I'm getting the error: >> >> Warning: odbc_connect() [function.odbc-connect]: SQL error: >> [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., >> SQL state S1000 in SQLConnect in ... >> >> The file is NOT already opened exclusively (or in any other manner) by >> another user. >> >> I have set every "permission" that I can think of to allow access to >> the MDB file. >> >> I have set the sharing/security on the folder where the MDB file is to >> allow "everyone" full control. >> >> One thing that showed up on a Google search taked about setting the >> "default open mode" in the database itself to "shared". I've done that >> - it made no difference. >> >> Another thread I found dealt with this exact same problem but the >> issue was never resolved - the guy said he was going to give up and >> move the MDB file to the server! >> >> Surely there must be a way around this. >> >> If it matters, I'm using PHP 5.2. I've tried it on two different >> server set-ups: one with WinXP Pro using IIS and the other Win2K using >> Apache. In both cases, the MDB file is on a computer running WinXP >> Pro. >> >> Any suggestions will be greatly appreciated. >> >> Thanks. >> >> > >This isn't a PHP problem - it's an ODBC one - it doesn't always handle >.mdb files on another server very well. You need an odbc or access >newsgroup or a different database. Personally, I would recommend the >latter. Thanks Jerry. I know it's not a PHP problem; I was just hoping someone here might know how to fix it. I'll see if I can find an ODBC newsgroup. |
|
#3
| |||
| |||
| Martin wrote: > Using ODBC in a PHP script, I'm trying to read an MS Access MDB file > that resides on another computer on my LAN. I'm getting the error: > > Warning: odbc_connect() [function.odbc-connect]: SQL error: > [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., > SQL state S1000 in SQLConnect in ... > > The file is NOT already opened exclusively (or in any other manner) by > another user. > > I have set every "permission" that I can think of to allow access to > the MDB file. > > I have set the sharing/security on the folder where the MDB file is to > allow "everyone" full control. > > One thing that showed up on a Google search taked about setting the > "default open mode" in the database itself to "shared". I've done that > - it made no difference. > > Another thread I found dealt with this exact same problem but the > issue was never resolved - the guy said he was going to give up and > move the MDB file to the server! > > Surely there must be a way around this. > > If it matters, I'm using PHP 5.2. I've tried it on two different > server set-ups: one with WinXP Pro using IIS and the other Win2K using > Apache. In both cases, the MDB file is on a computer running WinXP > Pro. > > Any suggestions will be greatly appreciated. > > Thanks. > > This isn't a PHP problem - it's an ODBC one - it doesn't always handle ..mdb files on another server very well. You need an odbc or access newsgroup or a different database. Personally, I would recommend the latter. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
#4
| |||
| |||
| "Martin" <ironwoodcanyon@gmail.com> wrote in message news:1qh7u393m3e0e3h04o2q9d8gcc5038ollm@4ax.com... > Using ODBC in a PHP script, I'm trying to read an MS Access MDB file > that resides on another computer on my LAN. I'm getting the error: > > Warning: odbc_connect() [function.odbc-connect]: SQL error: > [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., > SQL state S1000 in SQLConnect in ... > > The file is NOT already opened exclusively (or in any other manner) > by > another user. > > I have set every "permission" that I can think of to allow access to > the MDB file. > > I have set the sharing/security on the folder where the MDB file is > to > allow "everyone" full control. > > One thing that showed up on a Google search taked about setting the > "default open mode" in the database itself to "shared". I've done > that > - it made no difference. > > Another thread I found dealt with this exact same problem but the > issue was never resolved - the guy said he was going to give up and > move the MDB file to the server! > > Surely there must be a way around this. > > If it matters, I'm using PHP 5.2. I've tried it on two different > server set-ups: one with WinXP Pro using IIS and the other Win2K > using > Apache. In both cases, the MDB file is on a computer running WinXP > Pro. > > Any suggestions will be greatly appreciated. > > Thanks. > Do you use an UNC path or a mapped drive? I found it only owrked with one of them, dont remember which one though... R. |
|
#5
| |||
| |||
| On Fri, 21 Mar 2008 20:43:26 +0100, "Richard" <root@localhost> wrote: > >"Martin" <ironwoodcanyon@gmail.com> wrote in message >news:1qh7u393m3e0e3h04o2q9d8gcc5038ollm@4ax.com... >> Using ODBC in a PHP script, I'm trying to read an MS Access MDB file >> that resides on another computer on my LAN. I'm getting the error: >> >> Warning: odbc_connect() [function.odbc-connect]: SQL error: >> [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., >> SQL state S1000 in SQLConnect in ... >> >> The file is NOT already opened exclusively (or in any other manner) >> by >> another user. >> >> I have set every "permission" that I can think of to allow access to >> the MDB file. >> >> I have set the sharing/security on the folder where the MDB file is >> to >> allow "everyone" full control. >> >> One thing that showed up on a Google search taked about setting the >> "default open mode" in the database itself to "shared". I've done >> that >> - it made no difference. >> >> Another thread I found dealt with this exact same problem but the >> issue was never resolved - the guy said he was going to give up and >> move the MDB file to the server! >> >> Surely there must be a way around this. >> >> If it matters, I'm using PHP 5.2. I've tried it on two different >> server set-ups: one with WinXP Pro using IIS and the other Win2K >> using >> Apache. In both cases, the MDB file is on a computer running WinXP >> Pro. >> >> Any suggestions will be greatly appreciated. >> >> Thanks. >> > >Do you use an UNC path or a mapped drive? >I found it only owrked with one of them, dont remember which one >though... > >R. > Using UNC. But I tried it with a mapped drive with the same result. What I have not tried is a DSN; I really don't want to do it that way but, I suppose if I don't have a choice then I'll have to go that route. |
|
#6
| |||
| |||
| "Martin" <ironwoodcanyon@gmail.com> wrote in message news:ng58u3pvpr12mtog8rbbtm1j6aiikam222@4ax.com... > On Fri, 21 Mar 2008 20:43:26 +0100, "Richard" <root@localhost> > wrote: > >> >>"Martin" <ironwoodcanyon@gmail.com> wrote in message >>news:1qh7u393m3e0e3h04o2q9d8gcc5038ollm@4ax.com... >>> Using ODBC in a PHP script, I'm trying to read an MS Access MDB >>> file >>> that resides on another computer on my LAN. I'm getting the error: >>> >>> Warning: odbc_connect() [function.odbc-connect]: SQL error: >>> [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., >>> SQL state S1000 in SQLConnect in ... >>> >>> The file is NOT already opened exclusively (or in any other >>> manner) >>> by >>> another user. >>> >>> I have set every "permission" that I can think of to allow access >>> to >>> the MDB file. >>> >>> I have set the sharing/security on the folder where the MDB file >>> is >>> to >>> allow "everyone" full control. >>> >>> One thing that showed up on a Google search taked about setting >>> the >>> "default open mode" in the database itself to "shared". I've done >>> that >>> - it made no difference. >>> >>> Another thread I found dealt with this exact same problem but the >>> issue was never resolved - the guy said he was going to give up >>> and >>> move the MDB file to the server! >>> >>> Surely there must be a way around this. >>> >>> If it matters, I'm using PHP 5.2. I've tried it on two different >>> server set-ups: one with WinXP Pro using IIS and the other Win2K >>> using >>> Apache. In both cases, the MDB file is on a computer running WinXP >>> Pro. >>> >>> Any suggestions will be greatly appreciated. >>> >>> Thanks. >>> >> >>Do you use an UNC path or a mapped drive? >>I found it only owrked with one of them, dont remember which one >>though... >> >>R. >> > Using UNC. But I tried it with a mapped drive with the same result. > > What I have not tried is a DSN; I really don't want to do it that > way > but, I suppose if I don't have a choice then I'll have to go that > route. I would personally try anything to get something that works, and then go from there. Does it work ok when the db is local? Do you use a DSN-less connection with a connection string? Try the DSN way, first local, then remote. oh... BTW: >>> engine cannot open the file '(unknown)'. this looks strange. Are you sure you specify the correct path? What is your connection string anyway? R. |
|
#7
| |||
| |||
| On Sat, 22 Mar 2008 03:06:20 +0100, "Richard" <root@localhost> wrote: > >"Martin" <ironwoodcanyon@gmail.com> wrote in message >news:ng58u3pvpr12mtog8rbbtm1j6aiikam222@4ax.com... >> On Fri, 21 Mar 2008 20:43:26 +0100, "Richard" <root@localhost> >> wrote: >> >>> >>>"Martin" <ironwoodcanyon@gmail.com> wrote in message >>>news:1qh7u393m3e0e3h04o2q9d8gcc5038ollm@4ax.com... >>>> Using ODBC in a PHP script, I'm trying to read an MS Access MDB >>>> file >>>> that resides on another computer on my LAN. I'm getting the error: >>>> >>>> Warning: odbc_connect() [function.odbc-connect]: SQL error: >>>> [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., >>>> SQL state S1000 in SQLConnect in ... >>>> >>>> The file is NOT already opened exclusively (or in any other >>>> manner) >>>> by >>>> another user. >>>> >>>> I have set every "permission" that I can think of to allow access >>>> to >>>> the MDB file. >>>> >>>> I have set the sharing/security on the folder where the MDB file >>>> is >>>> to >>>> allow "everyone" full control. >>>> >>>> One thing that showed up on a Google search taked about setting >>>> the >>>> "default open mode" in the database itself to "shared". I've done >>>> that >>>> - it made no difference. >>>> >>>> Another thread I found dealt with this exact same problem but the >>>> issue was never resolved - the guy said he was going to give up >>>> and >>>> move the MDB file to the server! >>>> >>>> Surely there must be a way around this. >>>> >>>> If it matters, I'm using PHP 5.2. I've tried it on two different >>>> server set-ups: one with WinXP Pro using IIS and the other Win2K >>>> using >>>> Apache. In both cases, the MDB file is on a computer running WinXP >>>> Pro. >>>> >>>> Any suggestions will be greatly appreciated. >>>> >>>> Thanks. >>>> >>> >>>Do you use an UNC path or a mapped drive? >>>I found it only owrked with one of them, dont remember which one >>>though... >>> >>>R. >>> >> Using UNC. But I tried it with a mapped drive with the same result. >> >> What I have not tried is a DSN; I really don't want to do it that >> way >> but, I suppose if I don't have a choice then I'll have to go that >> route. > >I would personally try anything to get something that works, and then >go from there. >Does it work ok when the db is local? Yes. >Do you use a DSN-less connection with a connection string? Yes. >Try the DSN way, first local, then remote. Ok, I went back and did it this way but, no luck - I got the exact same error message. FWIW, I set up a "System DSN" (as opposed to a File DSN) >oh... BTW: > >>>> engine cannot open the file '(unknown)'. > >this looks strange. Are you sure you specify the correct path? I agree; I don't understand the "unknown" phrase either. Yes, I believe the path is correct. >What is your connection string anyway? "Driver={Microsoft Access Driver (*.MDB)}; DBQ=\\Arizona\C\CCSSoftware\KVK.MDB" "Arizona" is the name of the computer. "C" is, of course, the drive (which is shared) "CCSSoftware" is the folder (that is shared) "KVK.MDB" is the data file. Any additional thoughts anyone may have on this will be greatly appreciated. BTW, I posted this question in an ODBC newsgroup but have gotten no response. There appears to be very little activity there. |
|
#8
| |||
| |||
| Hi again, did you check here: http://nl3.php.net/manual/en/function.odbc-connect.php It has some remarks on this. R. |
|
#9
| |||
| |||
| "Martin" <ironwoodcanyon@gmail.com> wrote in message news:f6uau35ma0et1ahbm54sod9jukgqk6lkqv@4ax.com... > On Sat, 22 Mar 2008 03:06:20 +0100, "Richard" <root@localhost> > wrote: > >> >>"Martin" <ironwoodcanyon@gmail.com> wrote in message >>news:ng58u3pvpr12mtog8rbbtm1j6aiikam222@4ax.com... >>> On Fri, 21 Mar 2008 20:43:26 +0100, "Richard" <root@localhost> >>> wrote: >>> >>>> >>>>"Martin" <ironwoodcanyon@gmail.com> wrote in message >>>>news:1qh7u393m3e0e3h04o2q9d8gcc5038ollm@4ax.com... >>>>> Using ODBC in a PHP script, I'm trying to read an MS Access MDB >>>>> file >>>>> that resides on another computer on my LAN. I'm getting the >>>>> error: >>>>> >>>>> Warning: odbc_connect() [function.odbc-connect]: SQL error: >>>>> [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., >>>>> SQL state S1000 in SQLConnect in ... >>>>> >>>>> The file is NOT already opened exclusively (or in any other >>>>> manner) >>>>> by >>>>> another user. >>>>> >>>>> I have set every "permission" that I can think of to allow >>>>> access >>>>> to >>>>> the MDB file. >>>>> >>>>> I have set the sharing/security on the folder where the MDB file >>>>> is >>>>> to >>>>> allow "everyone" full control. >>>>> >>>>> One thing that showed up on a Google search taked about setting >>>>> the >>>>> "default open mode" in the database itself to "shared". I've >>>>> done >>>>> that >>>>> - it made no difference. >>>>> >>>>> Another thread I found dealt with this exact same problem but >>>>> the >>>>> issue was never resolved - the guy said he was going to give up >>>>> and >>>>> move the MDB file to the server! >>>>> >>>>> Surely there must be a way around this. >>>>> >>>>> If it matters, I'm using PHP 5.2. I've tried it on two different >>>>> server set-ups: one with WinXP Pro using IIS and the other Win2K >>>>> using >>>>> Apache. In both cases, the MDB file is on a computer running >>>>> WinXP >>>>> Pro. >>>>> >>>>> Any suggestions will be greatly appreciated. >>>>> >>>>> Thanks. >>>>> >>>> >>>>Do you use an UNC path or a mapped drive? >>>>I found it only owrked with one of them, dont remember which one >>>>though... >>>> >>>>R. >>>> >>> Using UNC. But I tried it with a mapped drive with the same >>> result. >>> >>> What I have not tried is a DSN; I really don't want to do it that >>> way >>> but, I suppose if I don't have a choice then I'll have to go that >>> route. >> >>I would personally try anything to get something that works, and >>then >>go from there. >>Does it work ok when the db is local? > > Yes. > >>Do you use a DSN-less connection with a connection string? > > Yes. > >>Try the DSN way, first local, then remote. > > Ok, I went back and did it this way but, no luck - I got the exact > same error message. FWIW, I set up a "System DSN" (as opposed to a > File DSN) > >>oh... BTW: >> >>>>> engine cannot open the file '(unknown)'. >> >>this looks strange. Are you sure you specify the correct path? > > I agree; I don't understand the "unknown" phrase either. Yes, I > believe the path is correct. > >>What is your connection string anyway? > "Driver={Microsoft Access Driver (*.MDB)}; > DBQ=\\Arizona\C\CCSSoftware\KVK.MDB" Should this not be: .... DBQ=\\\\Arizona\\C\\CCSSoftware\\KVK.MDB" R. |
|
#10
| |||
| |||
| "Martin" <ironwoodcanyon@gmail.com> wrote in message news:1qh7u393m3e0e3h04o2q9d8gcc5038ollm@4ax.com... > Using ODBC in a PHP script, I'm trying to read an MS Access MDB file > that resides on another computer on my LAN. I'm getting the error: > > Warning: odbc_connect() [function.odbc-connect]: SQL error: > [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., > SQL state S1000 in SQLConnect in ... > > The file is NOT already opened exclusively (or in any other manner) > by > another user. > > I have set every "permission" that I can think of to allow access to > the MDB file. > > I have set the sharing/security on the folder where the MDB file is > to > allow "everyone" full control. > > One thing that showed up on a Google search taked about setting the > "default open mode" in the database itself to "shared". I've done > that > - it made no difference. > > Another thread I found dealt with this exact same problem but the > issue was never resolved - the guy said he was going to give up and > move the MDB file to the server! > > Surely there must be a way around this. > > If it matters, I'm using PHP 5.2. I've tried it on two different > server set-ups: one with WinXP Pro using IIS and the other Win2K > using > Apache. In both cases, the MDB file is on a computer running WinXP > Pro. > > Any suggestions will be greatly appreciated. > > Thanks. > Hi again, did you check here: http://nl3.php.net/manual/en/function.odbc-connect.php It has some remarks on this. R. |

