PHP MsAccess ODBC Connection to database on Networked Volume

PHP MsAccess ODBC Connection to database on Networked Volume

am 20.09.2007 15:44:03 von Rodent

I have an IIS 6.0, 2003 Server running with PHP installed.

I have an access database with a DSN ODBC connection configured.

When this ODBC is configured to access the database locally - great,
works fine.
When configured to access a remote copy of this database I get the
following :

"....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 C:\Inetpub\wwwroot\PI\getdata.php on
line 3...."

I have tried to set permissions on the database stored on the
networked volume to allow the 'IUSR_servername' user on the web-server
to have rights but am unable. I've tried giving 'everyone' the full
rights to the database all to no avail.

Getting to the stage where I'm going to ask the end user to copy their
database permanantly to the server where the PHP page lives, and give
them a shortcut to it .... but .... it's reaally reaally annoying me
now and I'd like to sort it out properly.

Thanks for any help

Re: PHP MsAccess ODBC Connection to database on Networked Volume

am 20.09.2007 16:24:13 von Steve

"Rodent" wrote in message
news:1190295843.172575.319790@19g2000hsx.googlegroups.com...
>I have an IIS 6.0, 2003 Server running with PHP installed.
>
> I have an access database with a DSN ODBC connection configured.
>
> When this ODBC is configured to access the database locally - great,
> works fine.
> When configured to access a remote copy of this database I get the
> following :
>
> "....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 C:\Inetpub\wwwroot\PI\getdata.php on
> line 3...."
>
> I have tried to set permissions on the database stored on the
> networked volume to allow the 'IUSR_servername' user on the web-server
> to have rights but am unable. I've tried giving 'everyone' the full
> rights to the database all to no avail.


great! all of that *needed* to be done. however, the error message is not
related to file permissions. what you need to do now, is open up the db on
the network volume in *access*. once open, you need to set the options for
it (tools...options). next, go to the 'advanced' tab and set the 'default
open mode' to shared. close access. finally, go the the network volume where
the .mdb file is. once there, delete all .ldb files. then give it a go.

btw, afaicr, you can also massage some of that in your odbc config and/or
connection string.

i should state that you should *always* use a connection string instead of
actually creating a DSN for access. further, only use access db's when you
plan to have access provide the gui interface as well. mysql (and just about
any other db engine) beats the snot out of ms access in terms of speed,
reliability, and capacity. you'll find that out as soon as you get 2 users
simultaneously hitting it and your mdb file size gets to about 1MB.

but, that's just my 0.02 usd

> Getting to the stage where I'm going to ask the end user to copy their
> database permanantly to the server where the PHP page lives, and give
> them a shortcut to it .... but .... it's reaally reaally annoying me
> now and I'd like to sort it out properly.

that would require you to NOT use ms access. ;^)

Re: PHP MsAccess ODBC Connection to database on Networked Volume

am 20.09.2007 18:02:09 von Rodent

Normally work with PHP, FreeBSD and MySQL .... any problems can
usually be solved with the aid of google and a few good people like
your self. Unfortunately the user who I'm creating a 'nice browser
based front-end' for doesn't want to migrate her database to something
strange and wonderful like that.

Unfortunately I'm stuck with access and the settings you've just
suggested still give me the same error :-)

Any other suggestions will be gratefully received.... however I'm
getting closer and closer to just copying the bloody thing onto the
server and being done with it. Amazing how 'simple' jobs take s
long :-)

Cheers

Re: PHP MsAccess ODBC Connection to database on Networked Volume

am 21.09.2007 03:03:17 von Csaba

"Steve" wrote in message
news:0ovIi.5$gc5.1@newsfe02.lga...
>
> "Rodent" wrote in message
> news:1190295843.172575.319790@19g2000hsx.googlegroups.com...
>>I have an IIS 6.0, 2003 Server running with PHP installed.
>>
>> I have an access database with a DSN ODBC connection configured.
>>
>> When this ODBC is configured to access the database locally - great,
>> works fine.
>> When configured to access a remote copy of this database I get the
>> following :
>>
>> "....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 C:\Inetpub\wwwroot\PI\getdata.php on
>> line 3...."
>>
>> I have tried to set permissions on the database stored on the
>> networked volume to allow the 'IUSR_servername' user on the web-server
>> to have rights but am unable. I've tried giving 'everyone' the full
>> rights to the database all to no avail.
>
>
> great! all of that *needed* to be done. however, the error message is not
> related to file permissions. what you need to do now, is open up the db on
> the network volume in *access*. once open, you need to set the options for
> it (tools...options). next, go to the 'advanced' tab and set the 'default
> open mode' to shared. close access. finally, go the the network volume
> where the .mdb file is. once there, delete all .ldb files. then give it a
> go.
>
> btw, afaicr, you can also massage some of that in your odbc config and/or
> connection string.
>
> i should state that you should *always* use a connection string instead of
> actually creating a DSN for access. further, only use access db's when you
> plan to have access provide the gui interface as well. mysql (and just
> about any other db engine) beats the snot out of ms access in terms of
> speed, reliability, and capacity. you'll find that out as soon as you get
> 2 users simultaneously hitting it and your mdb file size gets to about
> 1MB.
>
> but, that's just my 0.02 usd
>
>> Getting to the stage where I'm going to ask the end user to copy their
>> database permanantly to the server where the PHP page lives, and give
>> them a shortcut to it .... but .... it's reaally reaally annoying me
>> now and I'd like to sort it out properly.
>
> that would require you to NOT use ms access. ;^)

Are you specifying a UNC path to the db-file? Or do you use a network share
with drive letter?
I vaguely remember one of the 2 didnt work.
Google probably remembers better than me.

Richard.

Re: PHP MsAccess ODBC Connection to database on Networked Volume

am 21.09.2007 07:06:41 von Steve

"Richard" wrote in message
news:46f3185a$0$28578$dbd41001@news.euronet.nl...
>
> "Steve" wrote in message
> news:0ovIi.5$gc5.1@newsfe02.lga...
>>
>> "Rodent" wrote in message
>> news:1190295843.172575.319790@19g2000hsx.googlegroups.com...
>>>I have an IIS 6.0, 2003 Server running with PHP installed.
>>>
>>> I have an access database with a DSN ODBC connection configured.
>>>
>>> When this ODBC is configured to access the database locally - great,
>>> works fine.
>>> When configured to access a remote copy of this database I get the
>>> following :
>>>
>>> "....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 C:\Inetpub\wwwroot\PI\getdata.php on
>>> line 3...."
>>>
>>> I have tried to set permissions on the database stored on the
>>> networked volume to allow the 'IUSR_servername' user on the web-server
>>> to have rights but am unable. I've tried giving 'everyone' the full
>>> rights to the database all to no avail.
>>
>>
>> great! all of that *needed* to be done. however, the error message is not
>> related to file permissions. what you need to do now, is open up the db
>> on the network volume in *access*. once open, you need to set the options
>> for it (tools...options). next, go to the 'advanced' tab and set the
>> 'default open mode' to shared. close access. finally, go the the network
>> volume where the .mdb file is. once there, delete all .ldb files. then
>> give it a go.
>>
>> btw, afaicr, you can also massage some of that in your odbc config and/or
>> connection string.
>>
>> i should state that you should *always* use a connection string instead
>> of actually creating a DSN for access. further, only use access db's when
>> you plan to have access provide the gui interface as well. mysql (and
>> just about any other db engine) beats the snot out of ms access in terms
>> of speed, reliability, and capacity. you'll find that out as soon as you
>> get 2 users simultaneously hitting it and your mdb file size gets to
>> about 1MB.
>>
>> but, that's just my 0.02 usd
>>
>>> Getting to the stage where I'm going to ask the end user to copy their
>>> database permanantly to the server where the PHP page lives, and give
>>> them a shortcut to it .... but .... it's reaally reaally annoying me
>>> now and I'd like to sort it out properly.
>>
>> that would require you to NOT use ms access. ;^)
>
> Are you specifying a UNC path to the db-file? Or do you use a network
> share with drive letter?
> I vaguely remember one of the 2 didnt work.
> Google probably remembers better than me.

probably me too. i always used a unc since that's one less thing i'd have
had to remember to do when i moved to production (map a drive and all).