Re: [sqlite] Create table - Error code: 21

2017-09-21 Thread Papa
The SQLite3 wrapper class and the client class use std::wstring, however, the wrapper performs the necessary conversion to std::string::data(), before submitting the requests to SQLite3. Nice of you to notice this provable cause. Thanks so much for the help. On 2017-09-21 5:37 PM, Keith

Re: [sqlite] Create table - Error code: 21

2017-09-21 Thread Papa
Sorry, I realized that the example provided in my last email was not as complete as it should have been. I hope the below example would do a better job. - namespace jme{ class Person{ .     std::wstring wapstr; //!< All Purpose Wide String     // Database    

Re: [sqlite] Create table - Error code: 21

2017-09-21 Thread Keith Medcalf
>> convert->toString >Please check this function to make sure it does what you think it >does. What happens if you leave it out and process the raw C string >instead ? You would have to change the string definition to a "normal" ASCII string. It is currently defined as UCS-2 characters and

Re: [sqlite] Create table - Error code: 21

2017-09-21 Thread Papa
Thanks for your help, in regards to your suggestion, here is the actual method that makes the call to createTable. void Person::CreateTable() {     try {     // Name's data     wapstr = L"CREATE TABLE ";     wapstr += table_name;     wapstr += L"(";     wapstr += L"id INT

Re: [sqlite] Create table - Error code: 21

2017-09-21 Thread R Smith
On 2017/09/21 10:07 AM, Papa wrote: The code shows what I have done to create a table, but ::sqlite3_prepare_v2 tells me: --- Exception --- Error message from SQLite3 - bad parameter or other API misuse Error code: 21 Perhaps show us the

Re: [sqlite] Create table - Error code: 21

2017-09-21 Thread Kees Nuyt
On Thu, 21 Sep 2017 04:07:36 -0400, Papa wrote: Just a side-note: >     wapstr += L"id INT PRIMARY KEY NOT NULL, "; "INT PRIMARY KEY" is not enough to create an alias for ROWID, that only happenes with "INTEGER PRIMARY KEY" : ~ $ sqlite3 test.sqlite

Re: [sqlite] Create table - Error code: 21

2017-09-21 Thread Simon Slavin
On 21 Sep 2017, at 9:07am, Papa wrote: > convert->toString Please check this function to make sure it does what you think it does. What happens if you leave it out and process the raw C string instead ? Also check what Clemens wrong. What happens if you try to close the

Re: [sqlite] Create table - Error code: 21

2017-09-21 Thread Clemens Ladisch
Papa wrote: > // *** THE ERROR IS HERE > this->rc = ::sqlite3_prepare_v2(db, > convert->toString(sql_statement_request).c_str(), -1, _sql_statement, > NULL); > if (this->rc != SQLITE_OK) { > this->apstr = "Error message from SQLite3 "; >

[sqlite] Create table - Error code: 21

2017-09-21 Thread Papa
void myClass::CreateTable() {     try {     // Name's data     wapstr = L"CREATE TABLE ";     wapstr += table_name;     wapstr += L"(";     wapstr += L"id INT PRIMARY KEY NOT NULL, ";     wapstr += L"title_name TEXT, ";     wapstr += L"first_name TEXT, ";