Permissions error trying to open MDB file with ODBC

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 ...

Go Back   Application Development Forum > Programming Languages > PHP

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 03-21-2008, 10:35 AM
Martin
Guest
 
Default Permissions error trying to open MDB file with ODBC

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.

Reply With Quote
  #2  
Old 03-21-2008, 01:19 PM
Martin
Guest
 
Default Re: Permissions error trying to open MDB file with ODBC

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.
Reply With Quote
  #3  
Old 03-21-2008, 01:54 PM
Jerry Stuckle
Guest
 
Default Re: Permissions error trying to open MDB file with ODBC

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
==================

Reply With Quote
  #4  
Old 03-21-2008, 03:43 PM
Richard
Guest
 
Default Re: Permissions error trying to open MDB file with ODBC


"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.


Reply With Quote
  #5  
Old 03-21-2008, 04:12 PM
Martin
Guest
 
Default Re: Permissions error trying to open MDB file with ODBC

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.


Reply With Quote
  #6  
Old 03-21-2008, 10:06 PM
Richard
Guest
 
Default Re: Permissions error trying to open MDB file with ODBC


"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.


Reply With Quote
  #7  
Old 03-22-2008, 05:36 PM
Martin
Guest
 
Default Re: Permissions error trying to open MDB file with ODBC

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.

Reply With Quote
  #8  
Old 03-24-2008, 09:53 AM
Richard
Guest
 
Default Re: Permissions error trying to open MDB file with ODBC

Hi again,

did you check here:

http://nl3.php.net/manual/en/function.odbc-connect.php

It has some remarks on this.

R.


Reply With Quote
  #9  
Old 03-24-2008, 09:58 AM
Richard
Guest
 
Default Re: Permissions error trying to open MDB file with ODBC


"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.co m...
>>>>> 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.


Reply With Quote
  #10  
Old 03-25-2008, 10:22 AM
Richard
Guest
 
Default Re: Permissions error trying to open MDB file with ODBC


"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.



Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:14 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.