I'm trying to pull data from a MS Access .mdb and write it to a text file so I can then import it into my local mySql database.
If I try
- Code: Select all
try {
$dbh = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=cerfs1/f:/orsdata/ORSDATA.mdb;Uid=; Pwd=;");
}
catch (PDOException $e)
{
It fails. Where cerfs1 is the name of the server f: is the actual server drive letter /orsdata is the server folder and orsdata.mdb is the database.
I have tried every variation I can think of to get the drive but I am unable to do so and receive various errors.
If I copy the database and put it in c:/xampp/htdocs/mywebsite/orsdata.mdb I can read from it just fine.
Is there some special trick to escape the local Xampp environment that I'm not aware of?
Here are some examples of the errors I receive:
Dbq=//cerfs1/orsdata/ORSDATA.mdb -> SQLSTATE[HY000] SQLDriverConnect: -1811 [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.
Dbq=//cerfs1/f:/orsdata/ORSDATA.mdb ->SQLSTATE[HY024] SQLDriverConnect: -1023 [Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
Dbq=cerfs1/f:/orsdata/ORSDATA.mdb ->SQLSTATE[HY000] SQLDriverConnect: -1044 [Microsoft][ODBC Microsoft Access Driver] Not a valid file name.
Dbq=10.50.10.12/f:/orsdata/ORSDATA.mdb -> SQLSTATE[HY000] SQLDriverConnect: -1044 [Microsoft][ODBC Microsoft Access Driver] Not a valid file name.
//Shared Drive is Y which is mapped to F:/orsdata
Dbq=Y:/ORSDATA.mdb -> SQLSTATE[HY024] SQLDriverConnect: -1023 [Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
Any thoughts, ideas is very much appreciated.