This list is closed, nobody may subscribe to it.
2000 |
Jan
|
Feb
(1) |
Mar
(53) |
Apr
(28) |
May
(5) |
Jun
(7) |
Jul
(16) |
Aug
(15) |
Sep
(10) |
Oct
(1) |
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(9) |
Feb
(7) |
Mar
(1) |
Apr
(7) |
May
(6) |
Jun
|
Jul
(15) |
Aug
(10) |
Sep
(2) |
Oct
(12) |
Nov
(3) |
Dec
(2) |
2002 |
Jan
(2) |
Feb
(12) |
Mar
(33) |
Apr
(30) |
May
(5) |
Jun
(18) |
Jul
(18) |
Aug
(47) |
Sep
(8) |
Oct
(7) |
Nov
(8) |
Dec
(13) |
2003 |
Jan
(48) |
Feb
(8) |
Mar
(10) |
Apr
(30) |
May
(6) |
Jun
(8) |
Jul
(19) |
Aug
(36) |
Sep
(19) |
Oct
(16) |
Nov
(11) |
Dec
(17) |
2004 |
Jan
(11) |
Feb
(22) |
Mar
(52) |
Apr
(45) |
May
(18) |
Jun
(72) |
Jul
(14) |
Aug
(31) |
Sep
(19) |
Oct
(27) |
Nov
(19) |
Dec
(25) |
2005 |
Jan
(16) |
Feb
(46) |
Mar
(50) |
Apr
(3) |
May
(21) |
Jun
(3) |
Jul
(24) |
Aug
(33) |
Sep
(25) |
Oct
(23) |
Nov
(30) |
Dec
(20) |
2006 |
Jan
(12) |
Feb
(11) |
Mar
(8) |
Apr
(15) |
May
(27) |
Jun
(15) |
Jul
(19) |
Aug
(5) |
Sep
(9) |
Oct
(1) |
Nov
(2) |
Dec
(3) |
2007 |
Jan
|
Feb
(3) |
Mar
(18) |
Apr
(5) |
May
(9) |
Jun
|
Jul
(10) |
Aug
(3) |
Sep
(8) |
Oct
(1) |
Nov
(7) |
Dec
(9) |
2008 |
Jan
(2) |
Feb
|
Mar
(10) |
Apr
(4) |
May
|
Jun
(5) |
Jul
(9) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(8) |
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(1) |
Dec
(20) |
2010 |
Jan
|
Feb
(2) |
Mar
|
Apr
(7) |
May
|
Jun
(23) |
Jul
(3) |
Aug
(6) |
Sep
(1) |
Oct
(4) |
Nov
(1) |
Dec
|
2011 |
Jan
(1) |
Feb
(26) |
Mar
(25) |
Apr
(11) |
May
(5) |
Jun
(5) |
Jul
(2) |
Aug
(39) |
Sep
(12) |
Oct
(6) |
Nov
|
Dec
|
2012 |
Jan
(19) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
|
Aug
(8) |
Sep
|
Oct
(3) |
Nov
(2) |
Dec
(3) |
2013 |
Jan
(6) |
Feb
|
Mar
(1) |
Apr
|
May
(7) |
Jun
(5) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
2014 |
Jan
(4) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(5) |
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Milton U. <mil...@ho...> - 2003-12-09 22:56:37
|
Hi!. I have a problem my code php "select codigo_pac, name from Pac" not works. Because the character "_" it's not recognized. What can I do?. I probe with mdb-sql too. Thank you. I have mdbtools, unixodbc, redhat, php systems. _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail |
From: <dav...@ya...> - 2003-12-09 08:13:53
|
I have submitted some patches to: http://sourceforge.net/tracker/index.php Here's the README included with the collection. A set of patches that: i) add an option to mdb-export to produce INSERT statements instead of a comma-separated file. This can ultimately be used to insert data into a table (see below) ii) add a (crude?) MySQL backend to backend.c. I have not spent a lot of time refining the choice of types and this can probably be improved. iii) a script called mdbdump that aims to work a bit like mysqldump. This uses the -I option added to mdb-export. This means that the following is now possible: mdbdump accessDB accessTable | mysql mysqlDB to get a table directly from an Access database to a MySQL database. iv) I have made a few other (mostly cosmetic) changes. IMPORTANT NOTES: i) I have created these patches after applying patches by David Mansfield to mdb-tools version 0.5rc2. In the gzip file I have included David Mansfield's collection of patches as a single file. To 'install' please do the following: a) get mdb-tools version 0.5rc2 b) apply David Mansfield's patches c) apply my patches ii) I am at the very wrong end of the C learning curve, just getting started. If I have done something gastly, please let me know. iii) I have also used diff for the first time today and haven't yet worked out how to use all of it's options. There are 3 files to patch: mdb-export.c, mdb-schema.c and backend.c. To patch each one you need to; patch mdb-export.c mdb-export.patch patch mdb-schema.c mdb-schema.patch patch backend.c backend.patch ===== David Whiting Adult Morbidity and Mortality Project (AMMP) Box 65243, Dar es Salaam, Tanzania Tel: +255 22 215 33 88 Fax: +255 22 215 33 85 ________________________________________________________________________ BT Yahoo! Broadband - Save £80 when you order online today. Hurry! Offer ends 21st December 2003. The way the internet was meant to be. http://uk.rd.yahoo.com/evt=21064/*http://btyahoo.yahoo.co.uk |
From: <dav...@ya...> - 2003-12-05 04:16:32
|
Thanks again Tomas. I have now registered. One further question about creating the patches. I have patched version 0.5rc2 with a collection of patches from David Mansfield (posted to this list a few months back). Should I create patches against the latest CVS version (that would therefore contain both David Mansfield's changes and my own) or just state that I have applied his patches and create patches that only include my changes? Some of the things I have done need some of the changes he made. Please excuse my naivety. Dave --- dd...@da... wrote: > http://sourceforge.net/projects/mdbtools is the > project's page > > when you scroll down, you will see a link called > Patches, > the url is this: > http://sourceforge.net/tracker/?atid=302294&group_id=2294&func=browse > > > Tomas > ===== David Whiting Adult Morbidity and Mortality Project (AMMP) Box 65243, Dar es Salaam, Tanzania Tel: +255 22 215 33 88 Fax: +255 22 215 33 85 ________________________________________________________________________ Download Yahoo! Messenger now for a chance to win Live At Knebworth DVDs http://www.yahoo.co.uk/robbiewilliams |
From: <dav...@ya...> - 2003-12-04 05:30:14
|
--- dd...@da... wrote: > I would suggest you to upload your patches at > sourceforge.net > so everyone could download them and try them > > Tomas Thanks Tomas. I've had a look at the sourceforge page for mdbtools and tried searching sourceforge for mdb-tools and mbdtools and can't see any place to upload patches. Do you know the URL? If so, can you send it to me? Thanks. Dave ===== David Whiting Adult Morbidity and Mortality Project (AMMP) Box 65243, Dar es Salaam, Tanzania Tel: +255 22 215 33 88 Fax: +255 22 215 33 85 ________________________________________________________________________ Download Yahoo! Messenger now for a chance to win Live At Knebworth DVDs http://www.yahoo.co.uk/robbiewilliams |
From: David M. <mdb...@dm...> - 2003-12-03 20:01:11
|
On Wed, 3 Dec 2003, Spengler Xavier wrote: > Hi, > thanks for your reply. > I have not yet tested mdbtools-0.5rc2 release, but, > it seems (I see this with a windows machine) that the mdb > file was initially created with Access95. > I've moved this file to Access2003, and it works fine now. > I've seen that mdbtools only supports Access since 97, it > seems to solve my problem. > (but I will test mdbtools-0.5rc2...) > To be clear, I meant mdbtools-0.5rc with the patch I had attached in that email. David -- /==============================\ | David Mansfield | | mdb...@db... | \==============================/ |
From: Spengler X. <xav...@ex...> - 2003-12-03 17:48:45
|
Hi, thanks for your reply. I have not yet tested mdbtools-0.5rc2 release, but, it seems (I see this with a windows machine) that the mdb file was initially created with Access95. I've moved this file to Access2003, and it works fine now. I've seen that mdbtools only supports Access since 97, it seems to solve my problem. (but I will test mdbtools-0.5rc2...) Regards, Xavier SPENGLER. David Mansfield wrote: > On Wed, 3 Dec 2003, Spengler Xavier wrote: > > >>Hi, >>I try to export data from a mdb file (JET4), mdb-tables >>seems OK, I have all tables. >>but when I try to export, I have different behaviour: >>- on the first table I have the following result (in the data >>part, the header are OK): >> ÿ,s))))))))))' >> >> ÿ,,,,* >> >> ÿ,b''''''''''% >>(and segmentation fault) >> >>- on the second table, I have no results (instead of thousands). >> > > > Try mdbtools-0.5rc2 with the attached patch. It fixes some bugs which may > be affecting you here (no guarantees though). If you give it a try, let > me know if it works or not (either way). > > Good luck, > David > > > > ------------------------------------------------------------------------ > > diff --exclude-from /home/sun1/david/dontdiff -urp mdbtools-0.5rc2.dist/include/mdbtools.h mdbtools-0.5rc2.patched/include/mdbtools.h > --- mdbtools-0.5rc2.dist/include/mdbtools.h 2003-01-12 17:59:42.000000000 -0500 > +++ mdbtools-0.5rc2.patched/include/mdbtools.h 2003-04-21 17:24:44.000000000 -0400 > @@ -327,13 +327,14 @@ extern int mdb_fetch_row(MdbTableDef *ta > extern int mdb_is_fixed_col(MdbColumn *col); > extern char *mdb_col_to_string(MdbHandle *mdb, int start, int datatype, int size); > extern int mdb_find_end_of_row(MdbHandle *mdb, int row); > - > +extern void mdb_set_date_fmt(const char *); > > /* dump.c */ > extern void buffer_dump(const unsigned char* buf, int start, int end); > > /* backend.c */ > extern char *mdb_get_coltype_string(MdbBackend *backend, int col_type); > +int mdb_coltype_takes_length(MdbBackend *backend, int col_type); > extern void mdb_init_backends(); > extern void mdb_register_backend(MdbBackend *backend, char *backend_name); > extern int mdb_set_default_backend(MdbHandle *mdb, char *backend_name); > diff --exclude-from /home/sun1/david/dontdiff -urp mdbtools-0.5rc2.dist/src/libmdb/backend.c mdbtools-0.5rc2.patched/src/libmdb/backend.c > --- mdbtools-0.5rc2.dist/src/libmdb/backend.c 2002-12-10 18:35:25.000000000 -0500 > +++ mdbtools-0.5rc2.patched/src/libmdb/backend.c 2003-05-15 14:39:16.000000000 -0400 > @@ -53,7 +53,7 @@ char *mdb_oracle_types[] = > "NUMBER", > "FLOAT", > "FLOAT", > - "DATE", > + "-DATE", > "Oracle_Unknown 0x09", > "VARCHAR2", > "BLOB", > @@ -112,15 +112,28 @@ int did_first; > > char *mdb_get_coltype_string(MdbBackend *backend, int col_type) > { > -char buf[100]; > +static char buf[100]; > if (col_type > 0x10) { > // return NULL; > sprintf(buf,"type %04x", col_type); > return buf; > } else { > - return backend->types_table[col_type]; > + char *str = backend->types_table[col_type]; > + if (*str == '-') > + str++; > + return str; > } > } > + > +int mdb_coltype_takes_length(MdbBackend *backend, int col_type) > +{ > + if (col_type > 0x10) { > + return 1; > + } else { > + return (*backend->types_table[col_type] != '-'); > + } > +} > + > /* > ** mdb_init_backends() initializes the mdb_backends hash and loads the builtin > ** backends > diff --exclude-from /home/sun1/david/dontdiff -urp mdbtools-0.5rc2.dist/src/libmdb/data.c mdbtools-0.5rc2.patched/src/libmdb/data.c > --- mdbtools-0.5rc2.dist/src/libmdb/data.c 2003-01-12 17:59:43.000000000 -0500 > +++ mdbtools-0.5rc2.patched/src/libmdb/data.c 2003-05-15 14:39:16.000000000 -0400 > @@ -22,12 +22,20 @@ > #include "math.h" > > #define MDB_DEBUG_OLE 1 > +#define OFFSET_MASK 0x1fff > > char *mdb_money_to_string(MdbHandle *mdb, int start, char *s); > static int _mdb_attempt_bind(MdbHandle *mdb, > MdbColumn *col, unsigned char isnull, int offset, int len); > char *mdb_num_to_string(MdbHandle *mdb, int start, int datatype, int prec, int scale); > > +static char date_fmt[64] = "%x %X"; > + > +void mdb_set_date_fmt(const char * fmt) > +{ > + date_fmt[63] = 0; > + strncpy(date_fmt, fmt, 63); > +} > > void mdb_bind_column(MdbTableDef *table, int col_num, void *bind_ptr) > { > @@ -52,29 +60,30 @@ mdb_find_end_of_row(MdbHandle *mdb, int > MdbFormatConstants *fmt = mdb->fmt; > int row_end; > > - /* Search the previous "row start" values for the first non-deleted one. > + /* Search the previous "row start" values for the first non-'lookupflag' one. > * If we don't find one, then the end of the page is the correct value. > */ > #if 1 > if (row==0) { > row_end = fmt->pg_size - 1; > } else { > - row_end = (mdb_get_int16(mdb, ((fmt->row_count_offset + 2) + (row - 1) * 2)) & 0x0FFF) - 1; > + row_end = (mdb_get_int16(mdb, ((fmt->row_count_offset + 2) + (row - 1) * 2)) & OFFSET_MASK) - 1; > } > return row_end; > #else > + int i, row_start; > for (i = row - 1; i >= 0; i--) { > row_start = mdb_get_int16(mdb, ((fmt->row_count_offset + 2) + i * 2)); > + /* if lookupflag is not set, it's good (deleteflag is ok) */ > if (!(row_start & 0x8000)) { > break; > } > } > - row_start &= 0x0FFF; > > if (i == -1) { > row_end = fmt->pg_size - 1; > } else { > - row_end = row_start - 1; > + row_end = (row_start & OFFSET_MASK) - 1; > } > return row_end; > #endif > @@ -177,7 +186,7 @@ unsigned char isnull; > delflag = lookupflag = 0; > if (row_start & 0x8000) lookupflag++; > if (row_start & 0x4000) delflag++; > - row_start &= 0x0FFF; /* remove flags */ > + row_start &= OFFSET_MASK; /* remove flags */ > #if MDB_DEBUG > fprintf(stdout,"Row %d bytes %d to %d %s %s\n", > row, row_start, row_end, > @@ -253,7 +262,7 @@ unsigned char isnull; > } > > /* if fixed columns add up to more than 256, we need a jump */ > - if (col_start >= 256) { > + if (IS_JET3(mdb) && col_start >= 256) { > num_of_jumps++; > jumps_used++; > row_start = row_start + col_start - (col_start % 256); > @@ -394,24 +403,42 @@ mdb_read_next_dpg_by_map1(MdbTableDef *t > { > MdbCatalogEntry *entry = table->entry; > MdbHandle *mdb = entry->mdb; > -guint32 pgnum, i, j, bitn, map_pg; > +guint32 pgnum, i, j, bitn, map_pg, map_ind, offset, bit_offset; > unsigned char map_byte; > > - pgnum = 0; > + /* > + * table->cur_phys_pg will tell us where to (re)start the scan > + * for the next data page. each usage_map entry points to a > + * 0x05 page which bitmaps (mdb->fmt->pg_size - 4) * 8 pages. > + * > + * map_ind gives us the starting usage_map entry > + * offset gives us a page offset into the bitmap (must be converted > + * to bytes and bits). > + */ > + pgnum = table->cur_phys_pg + 1; > + map_ind = pgnum / ((mdb->fmt->pg_size - 4) * 8); > + offset = pgnum % ((mdb->fmt->pg_size - 4) * 8); > + bit_offset = offset % 8; > + > //printf("map size %ld\n", table->map_sz); > - for (i=1;i<table->map_sz-1;i+=4) { > + for (i = 4 * map_ind + 1; i<table->map_sz-1;i+=4) { > map_pg = _mdb_get_int32(table->usage_map, i); > //printf("loop %d pg %ld %02x%02x%02x%02x\n",i, map_pg,table->usage_map[i],table->usage_map[i+1],table->usage_map[i+2],table->usage_map[i+3]); > > - if (!map_pg) continue; > + /* if the usage_map entry is empty, skip it, but advance the page counter */ > + if (!map_pg) {pgnum += (mdb->fmt->pg_size - 4) * 8; continue;} > > if(mdb_read_alt_pg(mdb, map_pg) != mdb->fmt->pg_size) { > fprintf(stderr, "Oops! didn't get a full page at %d\n", map_pg); > exit(1); > } > //printf("reading page %ld\n",map_pg); > - for (j=4;j<mdb->fmt->pg_size;j++) { > - for (bitn=0;bitn<8;bitn++) { > + > + /* first time through, start j, bitn based on the starting offset > + * after that, reset offset to 0 to start at the beginning of the page/byte > + */ > + for (j=4 + offset / 8;j<mdb->fmt->pg_size;j++) { > + for (bitn=bit_offset;bitn<8;bitn++) { > if (mdb->alt_pg_buf[j] & 1 << bitn && pgnum > table->cur_phys_pg) { > table->cur_phys_pg = pgnum; > if (!mdb_read_pg(mdb, pgnum)) { > @@ -423,7 +450,10 @@ unsigned char map_byte; > } > pgnum++; > } > + bit_offset = 0; > } > + > + offset = 0; > } > /* didn't find anything */ > //printf("returning 0\n"); > @@ -476,7 +506,8 @@ int rc; > if (!table->cur_pg_num) { > table->cur_pg_num=1; > table->cur_row=0; > - mdb_read_next_dpg(table); > + if (!mdb_read_next_dpg(table)) > + return 0; > } > > do { > @@ -784,13 +815,39 @@ gint32 l, whole, fraction; > */ > return text; > } > + > +static int trim_trailing_zeros(char * buff, int n) > +{ > + char * p = buff + n - 1; > + while (p >= buff && *p == '0') > + *p-- = '\0'; > + if (*p == '.') > + *p = '\0'; > +} > + > + > +/* > + * how much precision should we ask for from printf and friends? > + * pass FLT_DIG for floats, DBL_DIG for doubles > + */ > +int max_dec_places(double f, int dig_prec) > +{ > + int ret = dig_prec - (int)ceil(log10(fabs(f))); > + /* always at least one digit of precision so the trim function works */ > + if (ret < 1) > + ret = 1; > + return ret; > +} > + > char *mdb_col_to_string(MdbHandle *mdb, int start, int datatype, int size) > { > /* FIX ME -- not thread safe */ > static char text[MDB_BIND_SIZE]; > char tmpbuf[10]; > time_t t; > -int i,j; > +int i,j,n; > +float tf; > +double td; > > switch (datatype) { > case MDB_BOOL: > @@ -810,11 +867,15 @@ int i,j; > return text; > break; > case MDB_FLOAT: > - sprintf(text,"%f",mdb_get_single(mdb, start)); > + tf = mdb_get_single(mdb, start); > + n = sprintf(text,"%.*f", max_dec_places(tf, FLT_DIG), tf); > + trim_trailing_zeros(text, n); > return text; > break; > case MDB_DOUBLE: > - sprintf(text,"%f",mdb_get_double(mdb, start)); > + td = mdb_get_double(mdb, start); > + n = sprintf(text,"%.*f", max_dec_places(td, DBL_DIG), td); > + trim_trailing_zeros(text, n); > return text; > break; > case MDB_TEXT: > @@ -846,7 +907,7 @@ int i,j; > break; > case MDB_SDATETIME: > t = (long int)((mdb_get_double(mdb, start) - 25569.0) * 86400.0); > - strftime(text, MDB_BIND_SIZE, "%x %X", > + strftime(text, MDB_BIND_SIZE, date_fmt, > (struct tm*)gmtime(&t)); > return text; > > diff --exclude-from /home/sun1/david/dontdiff -urp mdbtools-0.5rc2.dist/src/libmdb/file.c mdbtools-0.5rc2.patched/src/libmdb/file.c > --- mdbtools-0.5rc2.dist/src/libmdb/file.c 2003-01-12 17:59:43.000000000 -0500 > +++ mdbtools-0.5rc2.patched/src/libmdb/file.c 2003-05-15 19:20:58.000000000 -0400 > @@ -26,6 +26,70 @@ MdbFormatConstants MdbJet3Constants = { > 2048, 0x08, 12, 25, 27, 31, 35, 36, 43, 8, 13, 16, 1, 18 > }; > > +typedef struct _RC4_KEY > +{ > + unsigned char state[256]; > + unsigned char x; > + unsigned char y; > +} RC4_KEY; > + > +#define swap_byte(x,y) t = *(x); *(x) = *(y); *(y) = t > + > +void RC4_set_key(RC4_KEY *key, int key_data_len, unsigned char *key_data_ptr) > +{ > + int i; > + unsigned char t; > + unsigned char swapByte; > + unsigned char index1; > + unsigned char index2; > + unsigned char* state; > + short counter; > + > + state = &key->state[0]; > + for(counter = 0; counter < 256; counter++) > + state[counter] = counter; > + key->x = 0; > + key->y = 0; > + index1 = 0; > + index2 = 0; > + for(counter = 0; counter < 256; counter++) > + { > + index2 = (key_data_ptr[index1] + state[counter] + index2) % 256; > + swap_byte(&state[counter], &state[index2]); > + index1 = (index1 + 1) % key_data_len; > + } > +} > + > +/* > + * this algorithm does 'encrypt in place' instead of inbuff/outbuff > + * note also: encryption and decryption use same routine > + * implementation supplied by (Adam Back) at <adam at cypherspace dot org> > + */ > + > +void RC4(RC4_KEY *key, int buffer_len, unsigned char * buff) > +{ > + unsigned char t; > + unsigned char x; > + unsigned char y; > + unsigned char* state; > + unsigned char xorIndex; > + short counter; > + > + x = key->x; > + y = key->y; > + state = &key->state[0]; > + for(counter = 0; counter < buffer_len; counter++) > + { > + x = (x + 1) % 256; > + y = (state[x] + y) % 256; > + swap_byte(&state[x], &state[y]); > + xorIndex = (state[x] + state[y]) % 256; > + buff[counter] ^= state[xorIndex]; > + } > + key->x = x; > + key->y = y; > +} > + > static size_t _mdb_read_pg(MdbHandle *mdb, unsigned char *pg_buf, unsigned long pg); > static int mdb_find_file(char *file_name, char *file_path, int bufsize) > { > @@ -118,8 +182,13 @@ MdbFile *f; > > /* get the db encryption key and xor it back to clear text */ > f->db_key = mdb_get_int32(mdb, 0x3e); > - f->db_key ^= 0xe15e01b9; > - > + > + /* I don't know if this value is valid for some versions? > + * it doesn't seem to be valid for the databases I have > + * > + * f->db_key ^= 0xe15e01b9; > + */ > + f->db_key ^= 0x4ebc8afb; > > /* get the db password located at 0x42 bytes into the file */ > for (pos=0;pos<14;pos++) { > @@ -209,6 +278,19 @@ off_t offset = pg * mdb->fmt->pg_size; > /* fprintf(stderr,"EOF reached %d bytes returned.\n",len, mdb->fmt->pg_size); */ > return 0; > } > + > + /* > + * unencrypt the page if necessary. > + * it might make sense to cache the unencrypted data blocks? > + */ > + if (pg != 0 && mdb->f->db_key != 0) > + { > + RC4_KEY rc4_key; > + unsigned int tmp_key = mdb->f->db_key ^ pg; > + RC4_set_key(&rc4_key, 4, (unsigned char *)&tmp_key); > + RC4(&rc4_key, mdb->fmt->pg_size, pg_buf); > + } > + > return len; > } > void mdb_swap_pgbuf(MdbHandle *mdb) > @@ -332,7 +414,7 @@ mdb_get_double(MdbHandle *mdb, int offse > #endif > double d; > > - if (offset <0 || offset+4 > mdb->fmt->pg_size) return -1; > + if (offset <0 || offset+8 > mdb->fmt->pg_size) return -1; > > memcpy(&d, &mdb->pg_buf[offset], 8); > > diff --exclude-from /home/sun1/david/dontdiff -urp mdbtools-0.5rc2.dist/src/libmdb/Makefile.am mdbtools-0.5rc2.patched/src/libmdb/Makefile.am > --- mdbtools-0.5rc2.dist/src/libmdb/Makefile.am 2003-01-05 09:58:33.000000000 -0500 > +++ mdbtools-0.5rc2.patched/src/libmdb/Makefile.am 2003-04-21 14:52:12.000000000 -0400 > @@ -1,4 +1,5 @@ > lib_LTLIBRARIES = libmdb.la > libmdb_la_SOURCES= catalog.c mem.c file.c kkd.c table.c data.c dump.c backend.c money.c sargs.c index.c like.c write.c stats.c > INCLUDES = -I$(top_srcdir)/include $(GLIB_CFLAGS) > -LIBS = $(GLIB_LIBS) > +LIBS = $(GLIB_LIBS) -lm > + > diff --exclude-from /home/sun1/david/dontdiff -urp mdbtools-0.5rc2.dist/src/libmdb/Makefile.in mdbtools-0.5rc2.patched/src/libmdb/Makefile.in > --- mdbtools-0.5rc2.dist/src/libmdb/Makefile.in 2003-01-15 11:39:13.000000000 -0500 > +++ mdbtools-0.5rc2.patched/src/libmdb/Makefile.in 2003-04-21 14:56:01.000000000 -0400 > @@ -104,7 +104,7 @@ install_sh = @install_sh@ > lib_LTLIBRARIES = libmdb.la > libmdb_la_SOURCES = catalog.c mem.c file.c kkd.c table.c data.c dump.c backend.c money.c sargs.c index.c like.c write.c stats.c > INCLUDES = -I$(top_srcdir)/include $(GLIB_CFLAGS) > -LIBS = $(GLIB_LIBS) > +LIBS = $(GLIB_LIBS) -lm > subdir = src/libmdb > mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs > CONFIG_CLEAN_FILES = > diff --exclude-from /home/sun1/david/dontdiff -urp mdbtools-0.5rc2.dist/src/libmdb/mem.c mdbtools-0.5rc2.patched/src/libmdb/mem.c > --- mdbtools-0.5rc2.dist/src/libmdb/mem.c 2003-01-12 17:59:43.000000000 -0500 > +++ mdbtools-0.5rc2.patched/src/libmdb/mem.c 2003-04-21 17:24:44.000000000 -0400 > @@ -18,7 +18,7 @@ > */ > > #include "mdbtools.h" > - > +#include <locale.h> > void mdb_init() > { > mdb_init_backends(); > diff --exclude-from /home/sun1/david/dontdiff -urp mdbtools-0.5rc2.dist/src/libmdb/table.c mdbtools-0.5rc2.patched/src/libmdb/table.c > --- mdbtools-0.5rc2.dist/src/libmdb/table.c 2003-01-12 17:59:43.000000000 -0500 > +++ mdbtools-0.5rc2.patched/src/libmdb/table.c 2003-05-15 14:39:16.000000000 -0400 > @@ -123,23 +123,29 @@ GSList *slist = NULL; > buffer_dump(mdb->pg_buf, cur_col ,cur_col + 18); */ > #endif > memset(&col, 0, sizeof(col)); > - col.col_num = mdb->pg_buf[cur_col + fmt->col_num_offset]; > > read_pg_if(mdb, &cur_col, 0); > col.col_type = mdb->pg_buf[cur_col]; > > + read_pg_if(mdb, &cur_col, fmt->col_num_offset); // col_num_offset == 1 or 5 > + col.col_num = mdb->pg_buf[cur_col + fmt->col_num_offset]; > + > + /* FIXME: can this be right in Jet3 and Jet4? */ > if (col.col_type == MDB_NUMERIC) { > + read_pg_if(mdb, &cur_col, 11); > col.col_prec = mdb->pg_buf[cur_col + 11]; > + > + read_pg_if(mdb, &cur_col, 12); > col.col_scale = mdb->pg_buf[cur_col + 12]; > } > > - read_pg_if(mdb, &cur_col, 13); > - col.is_fixed = mdb->pg_buf[cur_col + fmt->col_fixed_offset] & > + read_pg_if(mdb, &cur_col, fmt->col_fixed_offset);// col_fixed_offset == 13 or 15 > + col.is_fixed = mdb->pg_buf[cur_col + fmt->col_fixed_offset] & > 0x01 ? 1 : 0; > if (col.col_type != MDB_BOOL) { > - read_pg_if(mdb, &cur_col, 17); > - low_byte = mdb->pg_buf[cur_col + fmt->col_size_offset]; > - read_pg_if(mdb, &cur_col, 18); > + read_pg_if(mdb, &cur_col, fmt->col_size_offset); //col_size_offset == 16 or 23 > + low_byte = mdb->pg_buf[cur_col + fmt->col_size_offset]; > + read_pg_if(mdb, &cur_col, fmt->col_size_offset + 1); > high_byte = mdb->pg_buf[cur_col + fmt->col_size_offset + 1]; > col.col_size += high_byte * 256 + low_byte; > } else > @@ -179,14 +185,19 @@ GSList *slist = NULL; > if (len < name_sz) { > /* read the next pg */ > mdb_read_pg(mdb, mdb_get_int32(mdb,4)); > + /* adjust cur_name to the new page - it will actually > + * be positioned before the start of valid data, but > + * since len was not reset, we should start exactly in > + * the right place. be careful of odd/even bytes (unicode...) > + */ > cur_name = 8 - (fmt->pg_size - cur_name); > - if (len % 2) cur_name++; > /* get the rest of the name */ > - for (j=0;j<len;j+=2) { > + for (j=len;j<name_sz;j++) { > + if (!(j%2)) > + pcol->name[j/2] = mdb->pg_buf[cur_name + j]; > } > - memcpy(&pcol->name[len], &mdb->pg_buf[cur_name], name_sz - len); > } > - pcol->name[name_sz]='\0'; > + pcol->name[name_sz/2]='\0'; > > cur_name += name_sz; > } else if (IS_JET3(mdb)) { > diff --exclude-from /home/sun1/david/dontdiff -urp mdbtools-0.5rc2.dist/src/util/mdb-export.c mdbtools-0.5rc2.patched/src/util/mdb-export.c > --- mdbtools-0.5rc2.dist/src/util/mdb-export.c 2002-12-10 18:35:25.000000000 -0500 > +++ mdbtools-0.5rc2.patched/src/util/mdb-export.c 2003-04-21 17:24:44.000000000 -0400 > @@ -38,7 +38,7 @@ char quote_text = 1; > int opt; > char *s; > > - while ((opt=getopt(argc, argv, "HQd:"))!=-1) { > + while ((opt=getopt(argc, argv, "HQd:D:"))!=-1) { > switch (opt) { > case 'H': > header_row = 0; > @@ -50,6 +50,9 @@ char *s; > delimiter = (char *) malloc(strlen(optarg)+1); > strcpy(delimiter, optarg); > break; > + case 'D': > + mdb_set_date_fmt(optarg); > + break; > default: > break; > } > @@ -100,6 +103,7 @@ char *s; > } > > while(mdb_fetch_row(table)) { > + col=g_ptr_array_index(table->columns,0); > if (quote_text && is_text_type(col->col_type)) { > fprintf(stdout,"\""); > for (s=bound_values[0];*s;s++) { > diff --exclude-from /home/sun1/david/dontdiff -urp mdbtools-0.5rc2.dist/src/util/mdb-schema.c mdbtools-0.5rc2.patched/src/util/mdb-schema.c > --- mdbtools-0.5rc2.dist/src/util/mdb-schema.c 2002-12-30 11:38:52.000000000 -0500 > +++ mdbtools-0.5rc2.patched/src/util/mdb-schema.c 2003-04-21 17:24:41.000000000 -0400 > @@ -17,9 +17,11 @@ > */ > > /* this utility dumps the schema for an existing database */ > - > +#include <ctype.h> > #include "mdbtools.h" > > +static char *sanitize_name(char *str, int sanitize); > + > main (int argc, char **argv) > { > int i, j, k; > @@ -29,6 +31,8 @@ MdbTableDef *table; > MdbColumn *col; > char *the_relation; > char *tabname = NULL; > +char *namespace = ""; > +int s = 0; > int opt; > > if (argc < 2) { > @@ -36,12 +40,19 @@ int opt; > exit (1); > } > > - while ((opt=getopt(argc, argv, "T:"))!=-1) { > + while ((opt=getopt(argc, argv, "T:N:S"))!=-1) { > switch (opt) { > case 'T': > tabname = (char *) malloc(strlen(optarg)+1); > strcpy(tabname, optarg); > break; > + case 'N': > + namespace = (char *) malloc(strlen(optarg)+1); > + strcpy(namespace, optarg); > + break; > + case 'S': > + s = 1; > + break; > } > } > > @@ -50,7 +61,7 @@ int opt; > /* open the database */ > > mdb = mdb_open (argv[optind]); > - if (argc - optind >2) { > + if (argc - optind >= 2) { > if (!mdb_set_default_backend(mdb, argv[optind + 1])) { > fprintf(stderr,"Invalid backend type\n"); > mdb_exit(); > @@ -82,10 +93,10 @@ int opt; > if (!strcmp (mdb_get_objtype_string (entry->object_type), "Table")) > { > /* drop the table if it exists */ > - fprintf (stdout, "DROP TABLE %s;\n", entry->object_name); > + fprintf (stdout, "DROP TABLE %s%s;\n", namespace, sanitize_name(entry->object_name, s)); > > /* create the table */ > - fprintf (stdout, "CREATE TABLE %s\n", entry->object_name); > + fprintf (stdout, "CREATE TABLE %s%s\n", namespace, sanitize_name(entry->object_name, s)); > fprintf (stdout, " (\n"); > > table = mdb_read_table (entry); > @@ -99,10 +110,11 @@ int opt; > { > col = g_ptr_array_index (table->columns, k); > > - fprintf (stdout, "\t%s\t\t\t%s", col->name, > + fprintf (stdout, "\t%s\t\t\t%s", sanitize_name(col->name, s), > mdb_get_coltype_string (mdb->default_backend, col->col_type)); > > - if (col->col_size != 0) > + if (col->col_size != 0 && > + mdb_coltype_takes_length(mdb->default_backend, col->col_type)) > fprintf (stdout, " (%d)", col->col_size); > > if (k < table->num_cols - 1) > @@ -111,7 +123,7 @@ int opt; > fprintf (stdout, "\n"); > } > > - fprintf (stdout, "\n);\n"); > + fprintf (stdout, ");\n"); > fprintf (stdout, "-- CREATE ANY INDEXES ...\n"); > fprintf (stdout, "\n"); > } > @@ -133,3 +145,23 @@ int opt; > exit(0); > } > > + > +static char *sanitize_name(char *str, int sanitize) > +{ > + static char namebuf[256]; > + char *p = namebuf; > + > + if (!sanitize) > + return str; > + > + while (*str) > + { > + *p = isalnum(*str) ? *str : '_'; > + p++; > + str++; > + } > + > + *p = 0; > + > + return namebuf; > +} |
From: David M. <mdb...@dm...> - 2003-12-03 17:31:53
|
On Wed, 3 Dec 2003, Spengler Xavier wrote: > Hi, > I try to export data from a mdb file (JET4), mdb-tables > seems OK, I have all tables. > but when I try to export, I have different behaviour: > - on the first table I have the following result (in the data > part, the header are OK): > =FF,s)))))))= )))' > =20 > =FF,,,,* > =20 > =FF,b''''''''''% > (and segmentation fault) >=20 > - on the second table, I have no results (instead of thousands). >=20 Try mdbtools-0.5rc2 with the attached patch. It fixes some bugs which ma= y=20 be affecting you here (no guarantees though). If you give it a try, let=20 me know if it works or not (either way). Good luck, David --=20 /=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D\ | David Mansfield | | mdb...@db... | \=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D/ |
From: Spengler X. <xav...@ex...> - 2003-12-03 14:42:42
|
Hi, I try to export data from a mdb file (JET4), mdb-tables seems OK, I have all tables. but when I try to export, I have different behaviour: - on the first table I have the following result (in the data part, the header are OK): ÿ,s))))))))))' ÿ,,,,* ÿ,b''''''''''% (and segmentation fault) - on the second table, I have no results (instead of thousands). If someone could help me. It would be great. thanks for all. Regards, Xavier Spengler -- ------------------------------------------------- Xavier Spengler XAPool project: http://xapool.experlog.com Objectweb : http://www.objectweb.org Experlog : http://www.experlog.com 12, rue de la Tuilerie - 38170 Seyssinet - France Experlog : +(33) 4.38.12.91.72 |
From: <dav...@ya...> - 2003-12-03 08:57:45
|
Hi, First, a caveat. I don't "know" how to program in C, I have some idea with (mostly) scripting languages, and get a headache whenever I try to read up about pointers. I wanted to be able to use mdb-tools to dump data from Access tables to mysql, in a similar fashion to mysqldump. Even though http://mdbtools.sourceforge.net/ talks about MySQL as far as I could see there is no MySQL backend. So, with very little idea of what I was doing I managed to hack in a backend for MySQL into backend.c and made some other (mostly cosmetic) changes to some of the other files. [I want to spend more time checking to make sure I have mapped the most appropriate column types]. I also copied and hacked mdb-export.c and created mdb-dump-data.c which creates INSERT statements instead of exporting data as a CSV file. Finally I created a script (that I have called mdbdump) that combines mdb-schema and mdb-dump-data to create a schema and INSERT statements in a similar fashion to mysqldump. This means that I can now get an Access table straight into MySQL with the following one-liner: mdbdump accessdb accesstable | mysql mysqldb I would not call myself a programmer nor a developer but these (and other) changes seem to work and might be useful for others. What should I do with them? Use diff to create patches? If so, who should I send them to and how? Thanks. Dave PS. I should point out that I am using version 0.5rc2 after applying combined patches by David Mansfield. ===== David Whiting Adult Morbidity and Mortality Project (AMMP) Box 65243, Dar es Salaam, Tanzania Tel: +255 22 211 6145 Fax: +255 22 212 3289 ________________________________________________________________________ Download Yahoo! Messenger now for a chance to win Live At Knebworth DVDs http://www.yahoo.co.uk/robbiewilliams |
From: Adam W. <awi...@wh...> - 2003-11-21 23:57:48
|
[awilliam@estate2 mdbtools]$ ./autogen.sh **Warning**: I am going to run `configure' with no arguments. If you wish to pass any to it, please specify them on the `./autogen.sh' command line. processing . Running libtoolize... You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'. Running aclocal ... Running autoheader... configure.in:130: error: `src/Makefile' is already registered with AC_CONFIG_FILES. autoconf/status.m4:844: AC_CONFIG_FILES is expanded from... configure.in:130: the top level autom4te: /usr/bin/m4 failed with exit status: 1 autoheader: /usr/bin/autom4te failed with exit status: 1 Running automake --gnu ... configure.in:4: required file `include/config.h.in' not found src/extras/Makefile.am: installing `./depcomp' Running autoconf ... configure.in:130: error: `src/Makefile' is already registered with AC_CONFIG_FILES. autoconf/status.m4:844: AC_CONFIG_FILES is expanded from... configure.in:130: the top level autom4te: /usr/bin/m4 failed with exit status: 1 Running ./configure ... ./autogen.sh: line 148: ./configure: No such file or directory |
From: Jurgen at M. <ju...@ma...> - 2003-11-13 22:49:06
|
Hi, Which database are you looking to use on the Mac? There are lots of different options, everything from FileMaker to MySQL. Do you have Access on a PC someplace? The simplest way might be to simply export the data from the table as an Excel or tab-delimited text file, and import it into your database on OS X. ...jurgen On Thu, 13 Nov 2003 13:43:18 -0600, Ron Ripley wrote: > I am trying to find a way to convert MS Access MDB databases for use > on my PowerBook running panther. What's the simplest way to do this. > > thanks. > > > > ------------------------------------------------------- > This SF.Net email sponsored by: ApacheCon 2003, > 16-19 November in Las Vegas. Learn firsthand the latest > developments in Apache, PHP, Perl, XML, Java, MySQL, > WebDAV, and more! http://www.apachecon.com/ > _______________________________________________ > mdbtools-dev mailing list > mdb...@li... > https://lists.sourceforge.net/lists/listinfo/mdbtools-dev > --------------------------------------------------------------- Jurgen Schaub ju...@ma... Marketcom Pty Ltd http://www.marketcom.com.au/ Melbourne 03 9510 1544 --------------------------------------------------------------- |
From: Ron R. <rwr...@mt...> - 2003-11-13 19:43:20
|
I am trying to find a way to convert MS Access MDB databases for use on my PowerBook running panther. What's the simplest way to do this. thanks. |
From: Tim <ti...@te...> - 2003-11-13 10:15:57
|
On Thu, Nov 13, 2003 at 11:04:12AM +0800, ?????? wrote: > Dear mdbtools-dev! ! > Can I subscribe this mail-list? By all means! Go here: http://lists.sourceforge.net/lists/listinfo/mdbtools-dev Enter a password, confirm that password, and click Subscribe. ! > I'm from china, my name is Sam Fang. Hi Sam! My name is Tim.. ! > Now, I'm working in ThizLinux.com.cn And the mail -list is help for my > work. Cool beans! I saw your product on the $200 (IIRC) PCs at Fry's. Those machines were shut off (..bastards). I turned them back on.. ! Maybe someday when I have time I will go there and play around with your Thiz Linux distribution. > Happy business/ Sam Fang > Best Regards Thank you, Sam, same to you. - Tim |
From: <yf...@th...> - 2003-11-13 03:01:07
|
Dear mdbtools-dev! Can I subscribe this mail-list? I'm from china, my name is Sam Fang. Now, I'm working in ThizLinux.com.cn And the mail -list is help for my work. Thanks! Happy business/ Sam Fang Best Regards yf...@th... 2003-08-26 |
From: Gerry G. <mdb...@sn...> - 2003-11-12 19:44:01
|
Good day, I'm attempting to build mdbtools on a FreeBSD 5.1 system both using ports and by hand. It builds and installs fine when I don't use unixodbc or libiodbc support, but when I do a configure --with-unixodbc=/usr/local (or iodbc) it fails with the following errors: Making all in odbc Error expanding embedded variable. *** Error code 1 Stop in /usr/ports/databases/mdbtools/work/mdbtools-0.5/src. *** Error code 1 I have little experience with make so I've spent quite a few hours now on google looking for common causes of that error in a Makefile and there are two common resolutions. 1.) Root has . in its path. This was mostly in a thread about Freetype2. I do not use . in my path. 2.) A linux Makefile is being used on a FreeBSD system. I've tried using the mdbtools-0.5 in ports, as well as via http download from sourceforge, and I've tried the 0.5 from CVS as well as 0.5rc2 and all had the same problem. I appreciate any assistance or chatter on the topic. Thanks! -gg (by the way on the CVS version I also caught a typo in one of the .y scripts but didnt write down which one it was. Sorry. That was at about 20:00 GMT yesterday.) |
From: <dd...@da...> - 2003-11-11 15:43:47
|
Hi, I downloaded the source of stable version of mdb tools and I compiled it. I tried to export a table from 97 and 2000 mdb files. I'm experiencing the same problem for both. My table contains TEXT (I don't know how is it called under MDB, but in MySQL it's TEXT field, a field which can contain long HTML content for example) When I call this: mdb-export file.mdb tablename >dump-table.txt then the file dump-table.txt is created, but when I look inside it seems like last bytest of the text fields are sometimes stripped, and sometimes not. For example, there should be the row "10","<center>" but there is "10","<center" It is not with such short lines, but it's with the longer ones. This is not true for ALL rows, but many rows has this error. Is it fixed in cvs version? I would like to use stable release instead of CVS ones, but maybe you could tell me just to download CVS to fix it. Thank you Tomas |
From: <dd...@da...> - 2003-11-11 15:42:46
|
Well, maybe it's possible already but I didn't find how so maybe you should just update documentation :-) I think that in the case you are able to read mdb file then it could be easy for you to make mdb-2-mysqldump converter ... just echo mysql data definition and then mysql inserts. Then one can convert mdb file very simply to MySQL dump. I don't care about indexes, I need pure data only. At this time, I have to mdb-export into csv and then parse csv into mysql ... which is not easy for me. Tomas |
From: Patrick S. <sal...@sc...> - 2003-11-06 03:36:44
|
Hi, all. I've got a couple of questions for the community. I've been trying to figure this out, and either I'm missing something, or there are some problems with the 0.5-1 release... Here are my versions (on RedHat 8.0): mdbtools-0.5-1 mdbtools-devel-0.5-1 mdbtools-gui-0.5-1 mdbtools-odbc-0.5-1 'mdb-ver' recognizes the file format: (5:00pm) 3038>mdb-ver Replica63.mdb JET4 Yet 'mdb-schema' doesn't seem to do anything different in outputting the various backend formats that the man page claims: (5:01pm) 3039>mdb-schema Replica63.mdb postgres > Replica63.postgres-schema (5:01pm) 3040>mdb-schema Replica63.mdb > Replica63.access-schema (5:02pm) 3042>mdb-schema Replica63.mdb sybase > Replica63.sybase-schema (5:02pm) 3043>mdb-schema Replica63.mdb oracle > Replica63.oracle-schema (5:03pm) 3044>ls -lt Replica63.*-schema -rw-r--r-- 1 salsbury users 19993 Nov 5 17:03 Replica63.oracle-schema -rw-r--r-- 1 salsbury users 19993 Nov 5 17:02 Replica63.sybase-schema -rw-r--r-- 1 salsbury users 19993 Nov 5 17:02 Replica63.access-schema -rw-r--r-- 1 salsbury users 19993 Nov 5 17:01 Replica63.postgres-sche= ma (5:03pm) 3045>diff Replica63.access-schema Replica63.postgres-schema (5:04pm) 3046>diff Replica63.access-schema Replica63.sybase-schema (5:04pm) 3047>diff Replica63.access-schema Replica63.oracle-schema (5:04pm) 3048>=20 ...No answer on any diff. They're all the same. What gives? I can't find any doc for mdb-csvparse, other than the usage prompt, but it seg faults on anything I feed it: bootstrap(5:49pm) 3140>mdb-parsecsv Usage: mdb-parsecsv <file> (assumed extension .txt) bootstrap(5:49pm) 3141>mdb-parsecsv Customer_10-19-03.txt Segmentation fault =20 mdb-tables can see the table names just fine: (5:47pm) 3138>mdb-tables Replica63.mdb activities antennas applicants Categories components Contacts Customers Employees Employees1 Equipment frequencies inqiuiry Inventory Transactions= =20 [...etc...] mdb-export segfaults, though...=20 Here's a snippet, trimming out the personal data. It's failing near the end of what appears to be line 2: (6:00pm) 3160>mdb-export Replica63.mdb Customers Here's part of line 1, headers: CustomerID,Originated,EmployeeID,SalesAgent,Status,status codes,Action,Depends On, [...yadda...] Card,Longitude,s_GUID,Date Started Service,Gen_extended comments,extended comments,Latitude,Aen_extended comments,s_ColLineage,s_Generation,s_Lineage Reading LVAL page 0000f6 row num 0 row start 0 row stop 4095 [What's this stuff? Successful completion of a row? Or something odd?] Here's part of line 2, where it chokes: [...],"Satisfied with DSL.","","",,"","","","","","",,,"",1,"",,1,,128,D=CB Reading LVAL page 0000f6 row num 1 row start 9 row stop 0 Segmentation fault (6:00pm) 3161> =09 Note that odd character at the end... Might that just be from some odd character in the field? It seems to always fail at the DE(umlaut) in multiple attempts. Is this one of those f'ed up Microsoft custom-font things? Like when you get emails with \032 instead of apostrophes? I love those. :-) I'm not so sure, though. I've been trying to dump other tables than just "Customers", and they all seem to seg-fault on line 2. So either we've got some royally messed-up data, or mdb-tools doesn't parse certain things, or maybe some combination of both? I've been playing with this off-and-on for the past few weeks, trying to find some way to get the data out of M$Access so I can import it into MySQL or PostgreSQL. But so far I've dropped at least 7 hours (as time permits) with frustrating results like these, and I'm not faring so well in the "Open Source vs. Payware" argument wth my boss on this one. :-(=20 Lately, he's trying to get me to install Access on my machine so we can mail each other these huge replica files whenever one of us makes an edit. (No thanks!) But at the same time, I'm not coming up with a workable alternative. Any advice, pointers, or help? Is this toolkit still being actively maintained? Should I be looking for some other tool? Thanks in advance! :-) --=20 Pat ___________________Think For Yourself____________________ Patrick G. Salsbury - http://reality.sculptors.com/~salsbury/ Have you made (or are you about to make) a life-changing move? Got a story to tell or advice to share with others about to do the same? Join the UpSpin Project: http://reality.sculptors.com/lists.html --------------------------------------------------------- "If the words 'life, liberty, and the pursuit of happiness' don't include the right to experiment with your own consciousness, then the Declaration of Independence isn't worth the hemp it was written on." -- Terence Kemp McKenna, 1946-2000 |
From: Luca C. <lu...@pc...> - 2003-11-03 16:16:44
|
Hello Klemens, on 11/02/03 18:12, klemens zwischenbrugger wrote: > at least in access a name with a minus-sign is a bad one. > try to rename to something without "-" - sign. > ( "_" might be better.. ) > > Not sure if this is _your_ problem - just an idea... the problem is that I can't use the .mdb on M$ Access, as ATM my XP doesn't work and on the other hand I don't have M$ Access: the database comes from a client who wants to manage datas via his web site. Thx, bye, Gismo / Luca |
From: Luca C. <lu...@pc...> - 2003-11-02 16:39:04
|
Hello, I've the same problem as David Whiting, reported 2003/09/05 at 15:05, message title "mdbtools, unixodbc and openoffice.org". Here what I did on my Debian testing/unstable, kernel 2.6.0-test9, apache-1.3.28 and php4-4.3.3, following the HOWTO at: http://www.unixodbc.org/doc/OOoMySQL.pdf - apt-get install mysql-server > 4.0.13 - apt-get install unixodbc > 2.2.4 - apt-get install libmyodbc > 2.50.39 - tested MySQL and unixODBC working on OpenOffice.org - added MDBtools to unixODBC: 1) cat /etc/odbcinst.ini [MySQL] Description = MySQL driver Driver = /usr/lib/odbc/libmyodbc.so Setup = /usr/lib/odbc/libodbcmyS.so CPTimeout = CPReuse = FileUsage = 1 [MSAccess] Description = MDB Tools ODBC driver Driver = /usr/lib/libmdbodbc.so.0 Setup = FileUsage = 1 CPTimeout = CPReuse = 2) cat /etc/odbc.ini [MySQL-test] Description = MySQL database test Driver = MySQL Server = localhost Database = test Port = 3306 [Tosi-general] Description = Magazzino Driver = MSAccess Database = /home/luca/download/magazz.mdb Server = localhost Port = 5432 3) cat /home/luca/.odbc.ini [Tosi-user] Description = Magazzino Driver = MSAccess Database = /home/luca/download/magazz.mdb Server = localhost Port = 5432 - now I can add the 2 .mdb via "OpenOffice.org Data Sources" window, but I can't view tables, obtaining 2 differents errors: a) if I use above entry n.2) (named "Tosi-general"), I get this error SQL Status: 08001 > Error code: 1 [unixODBC]Could not find DSN in odbc.ini The connection to the data source "Tosi-general" could not be established. starting from a terminal, this is the line error Couldn't find DSN /home/luca/.odbc.ini in Tosi-general b) using above entry n.3) ("Tosi-user"), I don't have errors, but I can't see the tables and I don't have errors from OpenOffice.org, but from a terminal, this is the error Error at Line : syntax error near exec - if I open the .mdb from "gmdb2" I can successfully see all the tables and values inside them, even the export function works (the same as from the command-line) So, is there a possible solution? Thx, bye, Gismo / Luca |
From: Ted R. <te...@ph...> - 2003-10-31 19:49:20
|
Our way of solving this problem was to substitute MySQL for the Jet engine; that way MySQL could access the data as MySQL and Access could access it as Access. No need for updates, since both use the same data. Ted |
From: Jonathan H. <jon...@bt...> - 2003-10-31 09:26:15
|
I used the following script to scope up mdb data and dump it in mysql, but first I export the tables manually to mysql using ODBC from windows to get the bare bones table, then empty it, this ensures the csv`s I export will match the tables exactly on reimport. I need to refresh these tables alot to keep the data upto date and this script does that nicely extract echo "Bristol & West ASB<br>"; $mysqlcomm="mdb-export -d , '/public/B&W ASB/BAW-FPM ASB (Master).mdb' 'Branch Details' > /var/www/html/surveyfb/bawbrand.csv"; $dump=shell_exec("$mysqlcomm"); //empty table if (!($result = @ mysql_query ("DELETE FROM surveysfb.b_wbrand", $connection))) showerror(); //Set Mysql Table Date field back to text for import (MDB dates are in the wrong format) if (!($result = @ mysql_query ("ALTER TABLE surveysfb.b_whsaasb CHANGE `Audit_Date` `Audit_Date` VARCHAR(19) DEFAULT '1900-01-01 00:00:00'", $connection))) showerror(); //import csv if (!($result = @ mysql_query ( "LOAD DATA LOCAL INFILE '/var/www/html/surveyfb/bawbrand.csv' INTO TABLE surveysfb.b_wbrand FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' IGNORE 1 LINES (Branch_ID,Code,Name,Region,Address,Postcode,Short_Postcode,Manager,Title,Co ntact,Comment,Telephone_Number,Tel_Comment,Fax_Number,Fax_Comment,Telecom_Ty pe_ID,Telecom_Cont_ID,Telecom_Lines,Fax_Lines,EMail,MFT,MPT,FFT,FPT,Del_Mark ,BArea,New,Off,OffFloor,OffLift,fpmr,fpmc,fpmarea,BAreaM,Alloc,RAT)", $connection))) showerror(); //set date to sql format if (!($result = @ mysql_query ("UPDATE surveysfb.b_whsaasb SET Audit_Date = CONCAT(IF(MID(Audit_date,11,1)=' ',MID(Audit_Date,7,4),IF(MID(Audit_Date,7,1)='9',CONCAT('19',MID(Audit_Date, 7,2)), CONCAT('20',MID(Audit_Date,7,2)))),'-',LEFT(Audit_Date,2),'-',MID(Audit_Date ,4,2),' 00:00:00')", $connection))) showerror(); //set text field back to datetime if (!($result = @ mysql_query ("ALTER TABLE surveysfb.b_whsaasb CHANGE `Audit_Date` `Audit_Date` DATETIME DEFAULT '1900-01-01 00:00:00'", $connection))) showerror(); I dump about 5 large databases and reimport them. All the indexes are already set up on the bare bones tables that you ODBC export. I did all this because I couldn`t get MDB ODBC to work with anyone but root!! Jonathan Hartley Formula Project Management Ltd Merchants House Peckover Street Little Germany Bradford BD1 5BD Tel:- 01274 739990 Fax:- 01274 395557 Mobile:- 07711 376322 E-Mail:- ma...@fo... <mailto:ma...@fo...> > -----Original Message----- > From: mdb...@li... > [mailto:mdb...@li...]On Behalf Of > mdb...@li... > Sent: 31 October 2003 04:17 > To: mdb...@li... > Subject: mdbtools-dev digest, Vol 1 #301 - 4 msgs > > > Send mdbtools-dev mailing list submissions to > mdb...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/mdbtools-dev > or, via email, send a message with subject or body 'help' to > mdb...@li... > > You can reach the person managing the list at > mdb...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of mdbtools-dev digest..." > > > Today's Topics: > > 1. Import MDB to MySQL (Jurgen at Marketcom) > 2. Re: Import MDB to MySQL (Jim Shea) > 3. Re: Import MDB to MySQL (Matt) > 4. Re: Import MDB to MySQL (Jurgen at Marketcom) > > --__--__-- > > Message: 1 > Date: Thu, 30 Oct 2003 15:38:59 +1100 > To: mdb...@li... > From: Jurgen at Marketcom <ju...@ma...> > Organization: Marketcom > Subject: [mdb-dev] Import MDB to MySQL > > Hi, > > Has anyone already solved this problem? I'm looking to simply scoop all > the data from an MDB file and dump it into a MySQL database (or > whatever SQL, really, I just want to get this stuff into a real > database so I can do something useful with it :-) ). > > Thanks in advance! > > ......jurgen > > --------------------------------------------------------------- > Jurgen Schaub ju...@ma... > Marketcom Pty Ltd http://www.marketcom.com.au/ > Melbourne 03 9510 1544 > --------------------------------------------------------------- > > > --__--__-- > > Message: 2 > Date: Thu, 30 Oct 2003 07:09:58 -0800 > To: mdb...@li... > From: Jim Shea <js...@jp...> > Subject: Re: [mdb-dev] Import MDB to MySQL > > At 10/29/2003 08:38 PM, Jurgen at Marketcom wrote: > > >Hi, > > > >Has anyone already solved this problem? I'm looking to simply scoop all > >the data from an MDB file and dump it into a MySQL database (or > >whatever SQL, really, I just want to get this stuff into a real > >database so I can do something useful with it :-) ). > > I haven't been successful yet in a RH 7.3 environment. I'm trying > to do the > same thing (MDB -> MySQL via Perl). I have data in the MDB format > that has > been exported from Microsoft Project. Unfortunately every table and field > contains underscores. Because it's an export from another commercial > program I have no control over the object names. > > I can read the simplest MDB's I've created (without underscores) for > testing but get segmentation faults on the real data. Putting single or > double quotes around the table and field names as previously suggested > doesn't help. > > I'm running version 0.5. My SA is trying to build with the available > patches and from CVS but is having problems. Getting MDB Tools running > would be a lifesaver for me (I wouldn't have to run a Windows 2K server > anymore). > > Jim > > > > --__--__-- > > Message: 3 > Subject: Re: [mdb-dev] Import MDB to MySQL > From: Matt <ma...@ky...> > To: mdb...@li... > Date: 30 Oct 2003 16:45:18 +0000 > > I'm working on something kinda similar for a small web host who is just > migrating to a linux box (RH7.3) from windows. Some of the more brain > dead users want to continue uploading access dbs using frontpage or ftp. > Initially I was hoping to use mdb-tools odbc drivers in combo with > SunONE ASP to make everything dead simple, but no can do. > > But it sounds like I'm having a bit more luck than you. I've given up > trying to automate the table creation itself - that'll be a one-shot > thing so I'm resigned to doing it by hand. What I want is for users to > continue to publish databases, and for the actual data import to happen > automatically. > > I'm writing a perl daemon to do it: basically it creates a fifo in the > spot where the access db would normally be, with the same name. The > daemon then listens on the other side, pipes the incoming file to a temp > file, then launches mdb-export to make a csv, then uses mysqlimport to > plug that data into tables. > > There's ugly stuff with line-breaks inside columns and two-digit years > in date fields, but think I got that sorted. The problems really fly if > there's stuff in a table that mdb-tools just can't deal with, but so far > so good. > > The code still isn't complete, but drop me an email off list if you'd > like to steal it. > > > Putting single or > > double quotes around the table and field names as previously suggested > > doesn't help. > > Back ticks are your friends :) > > Matt > > > > > --__--__-- > > Message: 4 > Date: Fri, 31 Oct 2003 10:09:54 +1100 > From: Jurgen at Marketcom <ju...@ma...> > Subject: Re: [mdb-dev] Import MDB to MySQL > To: David Mansfield <mdb...@dm...> > Cc: mdb...@li... > Organization: Marketcom > > Hi all, > > On Thu, 30 Oct 2003 10:48:27 -0500 (EST), David Mansfield wrote: > > I've attached some files that accomplish the goal with an > Oracle database > > as the destination. YMMV. The scripts are GPLed. You will > need oracle, > > the oracle utilities (sqlldr), perl, perl DBI and DBD::Oracle > modules, and > > quite possibly some good luck. It does work reliably here though. > > [...] > > At first glance, this looks fantastic. Thanks very much for sharing > this. I should have been more clear in my original message - my > objective is to dump MDBs into MySQL automatically, triggered from a > PHP (or whatever) script. Looks like your stuff, or some version of it, > would work great. I'll share back any changes I make in case they're > useful for anyone else. > > I won't be able to do much with this for the next few days (other stuff > to do) but will report back on successes etc. > > Thanks again, happy weekend everyone. > > .....jurgen > > --------------------------------------------------------------- > Jurgen Schaub ju...@ma... > Marketcom Pty Ltd http://www.marketcom.com.au/ > Melbourne 03 9510 1544 > --------------------------------------------------------------- > > > > --__--__-- > > _______________________________________________ > mdbtools-dev mailing list > mdb...@li... > https://lists.sourceforge.net/lists/listinfo/mdbtools-dev > > > End of mdbtools-dev Digest > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.528 / Virus Database: 324 - Release Date: 16/10/2003 > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.528 / Virus Database: 324 - Release Date: 16/10/2003 |
From: Jurgen at M. <ju...@ma...> - 2003-10-30 23:21:17
|
Hi all, On Thu, 30 Oct 2003 10:48:27 -0500 (EST), David Mansfield wrote: > I've attached some files that accomplish the goal with an Oracle database > as the destination. YMMV. The scripts are GPLed. You will need oracle, > the oracle utilities (sqlldr), perl, perl DBI and DBD::Oracle modules, and > quite possibly some good luck. It does work reliably here though. > [...] At first glance, this looks fantastic. Thanks very much for sharing this. I should have been more clear in my original message - my objective is to dump MDBs into MySQL automatically, triggered from a PHP (or whatever) script. Looks like your stuff, or some version of it, would work great. I'll share back any changes I make in case they're useful for anyone else. I won't be able to do much with this for the next few days (other stuff to do) but will report back on successes etc. Thanks again, happy weekend everyone. .....jurgen --------------------------------------------------------------- Jurgen Schaub ju...@ma... Marketcom Pty Ltd http://www.marketcom.com.au/ Melbourne 03 9510 1544 --------------------------------------------------------------- |
From: Matt <ma...@ky...> - 2003-10-30 16:42:17
|
I'm working on something kinda similar for a small web host who is just migrating to a linux box (RH7.3) from windows. Some of the more brain dead users want to continue uploading access dbs using frontpage or ftp. Initially I was hoping to use mdb-tools odbc drivers in combo with SunONE ASP to make everything dead simple, but no can do. But it sounds like I'm having a bit more luck than you. I've given up trying to automate the table creation itself - that'll be a one-shot thing so I'm resigned to doing it by hand. What I want is for users to continue to publish databases, and for the actual data import to happen automatically. I'm writing a perl daemon to do it: basically it creates a fifo in the spot where the access db would normally be, with the same name. The daemon then listens on the other side, pipes the incoming file to a temp file, then launches mdb-export to make a csv, then uses mysqlimport to plug that data into tables. There's ugly stuff with line-breaks inside columns and two-digit years in date fields, but think I got that sorted. The problems really fly if there's stuff in a table that mdb-tools just can't deal with, but so far so good. The code still isn't complete, but drop me an email off list if you'd like to steal it. > Putting single or > double quotes around the table and field names as previously suggested > doesn't help. Back ticks are your friends :) Matt |
From: Jim S. <js...@jp...> - 2003-10-30 15:10:07
|
At 10/29/2003 08:38 PM, Jurgen at Marketcom wrote: >Hi, > >Has anyone already solved this problem? I'm looking to simply scoop all >the data from an MDB file and dump it into a MySQL database (or >whatever SQL, really, I just want to get this stuff into a real >database so I can do something useful with it :-) ). I haven't been successful yet in a RH 7.3 environment. I'm trying to do the same thing (MDB -> MySQL via Perl). I have data in the MDB format that has been exported from Microsoft Project. Unfortunately every table and field contains underscores. Because it's an export from another commercial program I have no control over the object names. I can read the simplest MDB's I've created (without underscores) for testing but get segmentation faults on the real data. Putting single or double quotes around the table and field names as previously suggested doesn't help. I'm running version 0.5. My SA is trying to build with the available patches and from CVS but is having problems. Getting MDB Tools running would be a lifesaver for me (I wouldn't have to run a Windows 2K server anymore). Jim |