Int cellPosition = (rowCtr * columns) + colCtr Ĭout << "Closed MyDb.db" << endl << endl Ĭout << "Please press any key to exit the program. Sqlite3_get_table(db, sqlSelect, &results, &rows, &columns, &error) Ĭerr << "Error executing SQLite3 query: " << sqlite3_errmsg(db) << endl << endl įor (int rowCtr = 0 rowCtr <= rows ++rowCtr)įor (int colCtr = 0 colCtr < columns ++colCtr) " << endl Ĭonst char *sqlSelect = "SELECT * FROM MyTable " Rc = sqlite3_exec(db, sqlInsert, NULL, NULL, &error) Ĭout << "Inserted a value into MyTable." << endl << endl Ĭout << "Retrieving values in MyTable. " << endl Ĭonst char *sqlInsert = "INSERT INTO MyTable VALUES(NULL, 'A Value') " Rc = sqlite3_exec(db, sqlCreateTable, NULL, NULL, &error) Ĭerr << "Error executing SQLite3 statement: " << sqlite3_errmsg(db) << endl << endl Ĭout << "Created MyTable." << endl << endl Ĭout << "Inserting a value into MyTable. Here is some example code to get you started:Ĭerr << "Error opening SQLite3 database: " << sqlite3_errmsg(db) << endl << endl Ĭout << "Opened MyDb.db." << endl << endl Ĭonst char *sqlCreateTable = "CREATE TABLE MyTable (id INTEGER PRIMARY KEY, value STRING) " After you add sqlite3.c to your project (right click the project and choose to add an existing file), you will need to right click on the sqlite3.c file in the Solution Explorer and change: Properties->Configuration Properties->C/C++->Precompiled Headers->Precompiled Header = Not Using Precompiled Headers Alternatively you can add the sqlite3.c file in your project, and the SQLite database engine will be included in your exe.You will need to include the sqlite3.dll in the same directory as your program (or in a System Folder). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |