SQLite BCB3


2006-08-10 12:37:49 AM
cppbuilder23
Hey yall, i'm trying to use SQLite3 with Borland C++ Builder 3.0
Professional. To setup SQLite I used Remy Lebeau's instructions as
listed here
groups.google.com/group/borland.public.cppbuilder.students/browse_thread/thread/967c6ccd741835a9/a6a6ec014fb158ea&q=&rnum=1&hl=en#a6a6ec014fb158ea
1) File>New>Library
2) Add all of the .c files from the SQLLite source into the library
(except
the shell.c and tclsqlite.c files)
3) Build the library
4) add the compiled .lib file to your main project
5) #include the sqlite.h header file
I did this and it works fine with a console application using the VCL.
Unfortunately it does not work with a windows application.
Does anyone have a clue why???
Code:
void __fastcall TfrmMain::Button1Click(TObject *Sender) {
char *zErrMsg, **result;
char buffer[80];
int rc, fcnt, rcnt;
sqlite3 *db;
rc = sqlite3_open("Test01.db", &db);
if (rc != SQLITE_OK) {
txtMessage->Text = "Could not open database!";
return;
}//end if
strcpy(buffer, "create table tblTest (testID integer)");
rc = sqlite3_get_table(db, buffer, &result, &rcnt, &fcnt, &zErrMsg);
if (rc != SQLITE_OK) {
txtMessage->Text = zErrMsg;
sqlite3_free(zErrMsg);
} else {
txtMessage->Text = "Success!";
}//end if
sqlite3_free_table(result);
}
Error Message:
malformed database schema - near "BLE": syntax error
TIA,
JJ