patches from Karl and Carl

This commit is contained in:
brianb 2000-03-14 00:53:17 +00:00
parent a1514812cf
commit cf19a9f85f
4 changed files with 45 additions and 29 deletions

30
README
View File

@ -1,25 +1,31 @@
This is mdbtools version 0.002
This is mdbtools version 0.01
This software is very, very pre-pre-pre-alpha (did I make my point?), so
unless you know C and probably a little something about databases and reverse
engineering file formats, you're welcome to try it out but don't expect much if anything to work.
This software is very pre-alpha, so don't expect to much unless you know C and
probably a little something about databases and reverse engineering file
formats, you're welcome to try it out but don't expect much if anything to work.
For the rest of you, read the HACKERS file for a description of where the code
stands and what has been gleened of the file format.
The initial goal of these tools is to be able to extract data structures and
data from mdb files. This goal may of course expand over time as the file
format becomes more well understood (if it ever does).
data from mdb files. This goal will of course expand over time as the file
format becomes more well understood. Also in the plans is a Gtk+ browser for
MDB files and a ODBC/SQL frontend.
To install type 'make' in the src directory and hope it works :-)
This will build three executables:
This will build some useful utilities:
mdb-dump -- a simple hex dump utility that I've been using to look at mdb files
prcat -- print the catalog table from an mdb file,
prkkd -- prints some info about design view data given the offset to it.
prtable -- prints some info about a table definition.
prdata -- prints a dump of the data given a table name.
mdb-dump -- simple hex dump utility that I've been using to look at mdb files
mdb-schema -- prints DDL for the specified table
mdb-export -- export table to CSV format
And some utilities useful for debugging:
prcat -- prints the catalog table from an mdb file,
prkkd -- dump of information about design view data given the offset to it.
prtable -- dump of a table definition.
prdata -- dump of the data given a table name.
Check out http://mdbtools.sourceforge.net for CVS, mailing list and similar.

13
TODO
View File

@ -1,11 +1,12 @@
Things to Do
------------
. Implement code for reading data rows
. Complete list of datatypes
. Figure out how to properly determine fixed of variable length columns
. Complete the list of datatypes
. Figure out how to properly determine fixed or variable length columns
. Figure out how NULLs are stored in data rows
. Figure out what happens for varchar columns > 256
. Write schema-export utility supporting different backend databases
. Write data-export utility supporting different backend databases
. Figure out what happens for varchar columns starting at > 256
. Modify mdb-schema utility support different backend databases
. Modify mdb-export to handle different delimiters/options
. Get autoconf working
. Check out text file unixODBC driver to see if it can be adapted to use
libmdb (it already has a SQL parser).

View File

@ -49,11 +49,17 @@ enum {
};
enum {
MDB_BOOL = 0x01,
MDB_BYTE = 0x02,
MDB_INT = 0x03,
MDB_LONGINT = 0x04,
MDB_MONEY = 0x05,
MDB_FLOAT = 0x06,
MDB_DOUBLE = 0x07,
MDB_SDATETIME = 0x08,
MDB_TEXT = 0x0a,
MDB_HYPERLINK = 0x0c
MDB_OLE = 0x0b,
MDB_MEMO = 0x0c,
MDB_REPID = 0x0f
};
typedef struct {
@ -134,6 +140,6 @@ extern char *mdb_col_to_string(MdbHandle *mdb, int start, int datatype, int size
/* dump.c */
void buffer_dump(const char* buf, int start, int end);
void buffer_dump(const unsigned char* buf, int start, int end);
#endif /* _mdbtools_h_ */

View File

@ -28,21 +28,24 @@ char *mdb_get_coltype_string(int col_type)
** its own mapping.
*/
static char *type_name[] = {"Unknown 0x00",
"Unknown 0x01",
"Unknown 0x02",
"Boolean",
"Byte",
"Integer",
"Long Integer",
"Unknown 0x05",
"Unknown 0x06",
"Unknown 0x07",
"Currency",
"Single",
"Double",
"DateTime (Short)",
"Unknown 0x09",
"Varchar",
"Unknown 0x0b"
"Hyperlink"
"Text",
"OLE",
"Memo/Hyperlink",
"Unknown 0x0d",
"Unknown 0x0e",
"Replication ID"
};
if (col_type > 11) {
if (col_type > 0x0f) {
return NULL;
} else {
return type_name[col_type];