Cannot make a dsn-less connection with a network path, ms access + php

  • HI, i have a dsn less connection to a ms access database with php.

    Im using this connection script, but actually the database is not in the program dir, it is in the network drive y:\

    $db_connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("Crafta.mdb") ." ;DefaultDir=". realpath(".");

    Im trying to do like this: with no results...

    $db_connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("y:\Crafta.mdb") ." ;DefaultDir=". realpath("y:");

    Also I tried this with no results: realpath("\\nas1\workware\OrderManager\Crafta.mdb")

    and yes, its in the same workgroup...

    NOte: The \\nas1 its a unix shared dir, not a windows share

    Thanks in advance.

  • I don't know anything about putting an Access MDB on a unix share, so I'd have to put it on a Windows share first, get it working there to be sure the unix piece wasn't a factor, then move it over.

    I have a suspicion that since you have to go through the Jet Engine to get to the Access data, and the Jet Engine is a Windows program, it's possible that that program doesn't know how to navigate a unix file system.

    I'm very curious to know how this turns out.

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

  • My immediate though is file locking.

    Remember any Access data base in use creates an .ldb to manage file locking. This in turn means that ALL users need read/write access to the database share to handle the .ldb file.

    OK if your permissions are correct, then I would look at how samba is handling file locking. At this point I give up. It is all stuff like oplocks and test params. A quick google will show that there appear to be a range of problems. Plus, of course, ldb files cause problems in Windows as well.

  • How about looking in some PHP forums, such as :

     

    http://www.phpfreaks.com/tutorials/61/0.php (Microsoft Access Database ODBC and PHP)

     

    http://aspn.activestate.com/ASPN/Cookbook/PHP/Recipe/163447  (Title: Microsoft Access Database Connectivity (DSN-Less) )

    http://www.phpbuilder.com/columns/siddarth20000228.php3  (Interfacing With MS Access 97+)

    Any joy at sites like that?

  • thanks for the input, i have seen all of them, and the first 2 are about windows host, and the 3d one has a broken when try to download the php code.

  • im not like an expert in samba, i only know how to share and set permissions and basic stuff like that, i dont really know much about locking, but one thing i know for sure is that that database its accesed at the same time by many windows access and excel clients with windows machines with no problems, i dont get an error code, it just cannoot connect to the data source......

    I take a look into the smb config file and its too too complex for me, it has many lockling options....

  • The thing was solved. I debbugeda the issue 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!!!

  • 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

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply