mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-07-16 07:48:34 +08:00
what version is an mdb file?
This commit is contained in:
parent
6ce4521627
commit
8ab30cf0d1
65
src/util/mdb-ver.c
Normal file
65
src/util/mdb-ver.c
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
/* MDB Tools - A library for reading MS Access database file
|
||||||
|
* Copyright (C) 2000 Brian Bruns
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "mdbtools.h"
|
||||||
|
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int rows;
|
||||||
|
int i, j;
|
||||||
|
unsigned char buf[2048];
|
||||||
|
MdbHandle *mdb;
|
||||||
|
MdbCatalogEntry entry;
|
||||||
|
MdbTableDef *table;
|
||||||
|
MdbColumn *col;
|
||||||
|
/* doesn't handle tables > 256 columns. Can that happen? */
|
||||||
|
char *bound_values[256];
|
||||||
|
char *delimiter = ",";
|
||||||
|
char header_row = 1;
|
||||||
|
char quote_text = 1;
|
||||||
|
int opt;
|
||||||
|
|
||||||
|
/*
|
||||||
|
** optind is now the position of the first non-option arg,
|
||||||
|
** see getopt(3)
|
||||||
|
*/
|
||||||
|
if (argc < 2) {
|
||||||
|
fprintf(stderr,"Usage: %s <file>\n",argv[0]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
mdb_init();
|
||||||
|
|
||||||
|
if (!(mdb = mdb_open(argv[optind]))) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
switch (mdb->jet_version) {
|
||||||
|
case MDB_VER_JET3:
|
||||||
|
printf("JET3\n");
|
||||||
|
break;
|
||||||
|
case MDB_VER_JET4:
|
||||||
|
printf("JET4\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
mdb_free_handle(mdb);
|
||||||
|
mdb_exit();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user