Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't connect to Access dB via ODBC

Status
Not open for further replies.

rhyno2k

IS-IT--Management
Jun 9, 2001
222
US
Hi,


I have a PHP script (on IIS 6) that needs to connect to an Access database (.mdb) on a different network server. I'm trying to connect to it via ODBC but keep getting the same error:
Code:
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 D:\Web\Sites\mysite\partsearch.php on line 52

I'm assuming this is a permissions issue...

I can browse to the .mdb file fine from the web server. I cannot add "WEBSERV\IUSR_WEBSERV" to the Security tab of the database folder -- it only will let me select accounts from the domain controller [sad]. However, even when I assign "Everyone" Full Control over the folder storing the database, I still get the error above in my PHP script, which simply does a connection check:
Code:
$conn=odbc_connect('parts','','');
if (!$conn){
	echo odbc_errormsg($conn);
	exit("Connection Failed: " . $conn);
} else {
	echo "Connected!";
}

If I copy the .mdb file locally on the web server, I can connect fine... but the .mdb needs to reside on the file server!

Any ideas on how I can get this working?


Thanks,
--RHYNO
 
I've had this same problem when I've had the local database open the same time I am trying to access it through a web page. When I close the database I have no problems.

It is a pain, though, to have to open the database to work on it and close the database to test it!

Hope that helps.
Gill
 
Hey Gill,

Mine won't access the .mdb even if it's wide open...

Anyone have any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top