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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

this combo: php on a windows2003 + ms access on a samba share 2

Status
Not open for further replies.

sugarferret

IS-IT--Management
Jul 11, 2005
33
US
hi, i didnt know where exactly to post this question:
This is the scneario, i have a unix samba share in my network, there are all the office stuff, including a share to a Ms access database wich its accessed from many windows clients.
Now i need to access that ms access database from http, so i installed apache+php in a windows server in the same workgroup, i did succesfully test when the ms access database was on the local windows server, but once i tried with the database in the actual server it didnt worked, i found few scripts in google about odbc, ole, and dsn-less connections, all of them worked when database resides in the local machine, but don work when database is in the actual unix samba share.

This is the script used with local machine test:

//$db_connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("\\\\POS-SERVER\C$\om\xxafta.mdb") ." ;DefaultDir=". realpath("\\\\POS-SERVER\C$\om");

this is the script used for samba share, it didnt work:
//$db_connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("\\\\nas1\workware\OrderManager\xxafta.mdb") ." ;DefaultDir=". realpath("\\\\nas1\workware\OrderManager");

What can I do? any adcvices will be apreciated/.

Live as a tortoise.
and rate my mullet:
 
I don't know windows very well, but why can't you mount the samba share on the windows machine and change the http root of apache to point to that directory?

Or better yet...

Install apache on the Linux box and link the file from there.

My personal preference would be to eliminate Access but importing to MySQL and creating the PHP code to access it through Apache. Not sure if that's feasible for your situaltion.

Mark
 
Oops, I overlooked the second part of the post.

so overlook the first part of mine. :)

Mark
 
you've commented out both script pieces. if this is not just an aberration of the forum then you should at least try removing the comment blocks.

please check that the correct ports are open on your nas to allow the connection through.

i suggest getting rid of the realpath functions. make sure that you have got your path canonically correct and hard code it.

i think you should also provide the systemdb element of the connection string if your database uses workgroup security.

you may also need to apply a uid and a pwd to the connection string.
 
Kozusnik: change all the database to mysql basis is not like an option at this time, i think i must found the way to be accessed from php being a ms access database, and yes, its good idea, i will try changing the apache root path to the share and post the results here...

jpadie: i posted the commented scripts because i have many of them in the php script, and are commented because i only use one at the same time, them are like my 2 of my bids.
I will check right now the php realpath fucntions in the php page, and what is the systemdb element of the connection string? my database has only one user called Admin with no password, and the group its called Admins... should I specify it in the connection string?



Live as a tortoise.
and rate my mullet:
 
if I change the document root of the apache conf to any drive it returns me this error: (only works with any path in drive c:)

The Apache2 service is starting.
The Apache2 service could not be started.

A service specific error occurred: 1.

More help is available by typing NET HELPMSG 3547.


Live as a tortoise.
and rate my mullet:
 
The thing was solved. I debbuged using the realpath php function...

I changed the user that apache uses to logon, to a samba authorized user acconunt, not the system account, and with this string:

$db_connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("\\\\nas1\\workware\\OrderManager\\xxafta.mdb") ." ;DefaultDir=". realpath("\\\\nas1\\workware\\OrderManager");

thanks to all!!!

Live as a tortoise.
and rate my mullet:
 
Now, i think i can do any conventional type of database connection... what should i use for faster response and performance?
ODBC? OLE? DSN-LESS?... or may be linking the access databse to the SQL Server i have installed on the web server?, what I really wish its to have a faster querying of the MS access database without compromising the performance of Our SQL Server database application.

There are 2 machines involved:

Mahcine1:
Dual Core Unix Server
Samba Server
MS Access Database


Machine1:
Dual Core Windows Server
Sql Server
Apache and PHP Server

Thanks in advance.

ALDO


Live as a tortoise.
and rate my mullet:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top