分类: 数据库开发技术
2008-11-24 13:17:53
#include
#include
int main( void )
{
sqlite3 *db=NULL;
char *zErrMsg = 0;
int rc;
rc = sqlite3_open("zieckey.db", &db); if( rc ){
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
sqlite3_close(db);
exit(1);
}
else printf("open zieckey.db successfully!\n");
sqlite3_close(db);
return 0;
}
gcc sample.c -o sample .o -lsqlite3
./sqdemo.o
open zieckey.db successfully!