I've been using the Java version of mdbtools to access a Microsoft Access database. The database has multiple tables in it. One of the tables is kept open and is being written to by an application throughout the day. When I tried to access the table (i.e. run the query select * from table) I got no results even though I could open up the table in Access and see rows. I started poking around in the mdbtools code, and found the problem in mdbtools.libmdb.table - in there is a line of code that sets the num rows for the table: table.num_rows = file.mdb_get_int32(mdb, fmt.tab_num_rows_offset); For the table in question, the num rows was always being set to 0. Looking at the data read from the table, it does seem to be set to 0. On a hunch, I modified the code to set table.num_rows = 1 if it found num_rows = 0. When I did this, I was then able to read all of the rows from the table.
I saw a question in the archived mailing lists about accessing locked tables, so I thought I'd post this for others.
Log in to post a comment.