From: Pietro B. <pie...@ya...> - 2004-09-28 16:34:25
|
Hi all, I tried to compile mdbtools-0.5 under windows ME with minGW environment and I had success, but I found a couple of bug that make the package not-working under this environment. My goal was to convert an old mdb file built with access 95 using the utility mdb-export. Under linux environment the whole file is correctly dumped to a csv format, while under windows only the first 6 records are dumped. The problem seems to be in mdb_fetch_row() procedure with the call to mdb_read_next_dpg() failing and making the program end. Going inside the code I found that the access to mdb file itself goes wrong and I think that the cause is the way file is open in _mdb_open(). I think the flag _O_BINARY should be included in open() call. This makes the package go beyond the first 6 records. Another problem I found is related to the last variable size field in mdb record. It seems to have a negative length so the field is handled by the library as empty. The bug seems to be solved by modifying the length and adding 256 to the negative value; this is what mdb_read_row() does for each other variable field in record. So moving the following code ( taken from mdb_read_row() source ) : if (len<0) len+=256; outside the else branch of "if(var_cols_found==var_cols)" test make the mdb-export work pretty well. I Hope this is helpful for making mdbtools even better ! Regards Pietro ___________________________________ Scopri Mister Yahoo! - il fantatorneo sul calcio di Yahoo! Sport http://it.seriea.fantasysports.yahoo.com/ |