Read MS ACCESS file in binary - metadata

I

Irfan Ahmed

I want to open the MS ACCESS databse in binary format and extract
1- MS ACCESS version
2- Number of tables in it
3- Number of columns in each table
4- Type of each field
5- NULL/NOT NULL status if each table field
6- Unique number

I don't want to use any ODBC connection or any object, just wanted to read
binary file and create the metadata of MS ACESS database.

Kind Regards,
Irfan
 
J

John Vinson

I don't want to use any ODBC connection or any object, just wanted to read
binary file and create the metadata of MS ACESS database.

Too bad. Microsoft has not published the trade-secret interior
architecture of Access databases, and keeps changing it from version
to version anyway.

AFAIK you cannot do what you are asking, at least not without
illegally reverse-engineering the structure of the .mdb file (again
and again for each version).

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
R

Randy

Irfan said:
I want to open the MS ACCESS databse in binary format and extract
1- MS ACCESS version
2- Number of tables in it
3- Number of columns in each table
4- Type of each field
5- NULL/NOT NULL status if each table field
6- Unique number

I don't want to use any ODBC connection or any object, just wanted to read
binary file and create the metadata of MS ACESS database.

Kind Regards,
Irfan

Irfan, the binary format for Access is Microsoft's property and its not
documented to neither the public or developers. Also the Access binary
format and architecture keep changing all the time, so it is an unreliable
method for creating good solutions. Also there are so many details that you
cannot even think or expect, even if you ever get to master the Access
binary format. Developers "MUST" use the API (DAO, ADO, ADOX, etc.) to
interact with databases (for more information check the MSDN Online
http://msdn.microsoft.com/office/). However if you still insist in dealing
with the binary format of Access go check Brian Bruns' amazing work at
http://cvs.sourceforge.net/viewcvs.py/mdbtools/mdbtools/HACKING?rev=1.23&view=markup

-Randy
 
A

Adrian Jansen

Irfan said:
I want to open the MS ACCESS databse in binary format and extract
1- MS ACCESS version
2- Number of tables in it
3- Number of columns in each table
4- Type of each field
5- NULL/NOT NULL status if each table field
6- Unique number

I don't want to use any ODBC connection or any object, just wanted to read
binary file and create the metadata of MS ACESS database.

Kind Regards,
Irfan

See other replies re reading the raw binary file. But you can get most
of what you want by looking at the MySysObjects tables within the
database. Certainly the number of tables, and structure of each is
available.

--
Regards,

Adrian Jansen adrianjansen at internode dot on dot net
Design Engineer J & K Micro Systems
Microcomputer solutions for industrial control
Note reply address is invalid, convert address above to machine form.
 
I

Irfan Ahmed

How should I open the MySysObjects table?


Adrian Jansen said:
See other replies re reading the raw binary file. But you can get most
of what you want by looking at the MySysObjects tables within the
database. Certainly the number of tables, and structure of each is
available.

--
Regards,

Adrian Jansen adrianjansen at internode dot on dot net
Design Engineer J & K Micro Systems
Microcomputer solutions for industrial control
Note reply address is invalid, convert address above to machine form.
 
I

Irfan Ahmed

Yes I know that its reverse engineering, and not doing for any illegal
stuff.

BTW, thanks for the information, I just wanted to open MS ACCESS 97 .MDB
files.
 
A

Adrian Jansen

Irfan said:
How should I open the MySysObjects table?


Open your database, and show the Tables as normal. Then go into
Tools|Options menu and select the View tab. Check the box "System
Objects". Then the system tables show in the database window.
MSysObjects contains the table names and a lot of other data. You can
also get a lot of data by running the Documentor, which creates tables
with all the field names, data types, lengths etc.

A quote from Duane Hookom:

This depends on your version of Access. Access 97 and earlier allow you to
save the results as a file. Access 2000 and later automatically save the
information in a wizard mdb. On my system, the file and table is:
DATABASE=C:\Documents and Settings\Duane Hookom\Application
Data\Microsoft\Access\ACWZUSRT.MDT;TABLE=doc_tblObjects
To get a query of TableName, FieldName, FieldType, FieldSize use this sql:
SELECT doc_tblObjects.Name AS TableName, doc_tblObjects_1.Name AS FieldName,
doc_tblObjects_1.Extra2 AS FieldType, doc_tblObjects_1.Extra3 AS FieldSize
FROM doc_tblObjects AS doc_tblObjects_1 INNER JOIN doc_tblObjects ON
doc_tblObjects_1.ParentID = doc_tblObjects.ID
WHERE (((doc_tblObjects_1.TypeID)=11));

-- Duane Hookom MS Access MVP

--
Regards,

Adrian Jansen adrianjansen at internode dot on dot net
Design Engineer J & K Micro Systems
Microcomputer solutions for industrial control
Note reply address is invalid, convert address above to machine form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top