follow my heart...
分类: 数据库开发技术
2006-08-21 16:39:57
#include#include static int callback(void *NotUsed, int argc, char **argv, char **azColName){ int i; for(i=0; i sqlite3_open(argv[1], &db); if( rc ){ fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db)); sqlite3_close(db); exit(1); } rc = sqlite3_exec(db, argv[2], callback, 0, &zErrMsg); if( rc!=SQLITE_OK ){ fprintf(stderr, "SQL error: %s\n", zErrMsg); } sqlite3_close(db); return 0; }