views:

414

answers:

3

I am using following PHP code to connect to MS Access database:

$odb_conn = new COM("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". $db_path.";";
$odb_conn->open($connstr);

How can I retrieve database catalog/metadata from the mdb file?

FOUND THE SOLUTION

$rs_meta = $odb_conn->OpenSchema(20, array(Null, Null, Null, "TABLE"));
A: 

This query will return the user-defined tables in an access db:

SELECT NAME FROM MSysObjects WHERE Type In (1,4,6) AND Left([Name],4)<>"MSYS"

Abbas
A: 

You will find information on ADO here :

The connection object has an OpenSchema method to get database schema information.

I don't know how to use MS Acces DB with PHP and how your new COM() object works, but I think it's better to use an OleDB connection instead an ADO object : http://msdn.microsoft.com/en-us/library/ms722784(VS.85).aspx

Michel
A: 

How Can I retrieve the UTF-8 Data in php from MS-ACCESS Database?