Jump to content

How To Read Msacess (*.mdb) Databases


Recommended Posts

Dear Support

 

Plz help. I need to access .mdb databases thru php.

 

This is my code

 

 

<?php

 

 

$dbName="Ancj.mdb";

 

 

if (!file_exists($dbName)) {

 

die("Could not find database file.");

 

}

 

$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;");

?>

 

 

This is the error I am getting

 

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[iM002] SQLDriverConnect: 0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified' in /a.php:13 Stack trace: #0 /a.php(13): PDO->__construct('odbc:DRIVER={Mi...') #1 {main} thrown in

 

 

 

Plz help in fixing this error.

 

Thanks in advance

 

  • Like 1
Link to comment
Share on other sites

It is installed, the server is Stevie. It's showing odbc under pdo

 

This is phpinfo of server Stevie. Plz help

 

 

odbc

 

ODBC Support enabled

Active Persistent Links 0

Active Links 0

ODBC library unixODBC

ODBC_INCLUDE -I/usr/include

ODBC_LFLAGS -L/usr/lib64

ODBC_LIBS -lodbc

 

Directive Local Value Master Value

odbc.allow_persistent On On

odbc.check_persistent On On

odbc.default_cursortype Static cursor Static cursor

odbc.default_db Not yet implemented Not yet implemented

odbc.default_pw ******** ********

odbc.default_user Not yet implemented Not yet implemented

odbc.defaultbinmode return as is return as is

odbc.defaultlrl return up to 4096 bytes return up to 4096 bytes

odbc.max_links Unlimited Unlimited

odbc.max_persistent Unlimited Unlimited

 

 

PDO

 

PDO support enabled

PDO drivers sqlite2, mysql, pgsql, odbc, sqlite

 

pdo_mysql

 

PDO Driver for MySQL enabled

Client API version 5.1.56

 

PDO_ODBC

 

PDO Driver for ODBC (unixODBC) enabled

ODBC Connection Pooling Enabled, strict matching

 

 

Link to comment
Share on other sites

On server Stevie. I don't know the port.

 

Please support plz help me out here. Heliohost is the best service provider with so many features that no other provide. I am sure the support will find a solution to this problem also.

 

Hoping for your cooperation

Link to comment
Share on other sites

Stevie doesn't run msaccess because we don't run Microsoft operating system. The local database options available are MySQL, PostgreSQL, and SQLite. If you find an msaccess database with remote access enabled you could connect to that, or you could convert your database to something that will work on our servers.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...