RE: [sqlite] starting with unicode

2006-08-16 Thread Rob Richardson
No, you don't need sqlite3_reset() inside the loop. The pseudocode should be: open prepare loop while not at end of file step read repeat finalize close For the "read" portion, use the sqlite_column_xxx() methods. And wrap every single string in your

Re: [sqlite] starting with unicode

2006-08-15 Thread Nikki Locke
Mark Wyszomierski wrote: > Why do we want to use sqlite3_reset() in the for loop? If I leave it > in, the loop keeps running forever since I guess it really does keep > resetting the sql statement. Do we need it though inside the while > loop when SQLITE_BUSY is returned though? Is that the

Re: [sqlite] starting with unicode

2006-08-15 Thread John Stanton
If you have no variables in your SQL (like SELECT * FROM ...) then you don't bind. If you have "SELECT * FROM junk WHERE name=?" then you need to bind like this. The bind is good until you do a reset. char that_name = "Harry"; ... rc = sqlite3_bind_text(xek, 1, that_name, -1,

Re: [sqlite] starting with unicode

2006-08-15 Thread John Stanton
Mark Wyszomierski wrote: John, Cory, thank you very much. I got execute plain statements ok by modifying my earlier posting a bit. I was able to create a table using the prepare statement. Previously I was using sqlite3_exec() to execute my statements and I could pass it a callback function

Re: [sqlite] starting with unicode

2006-08-15 Thread Mark Wyszomierski
Hi Nikki, Why do we want to use sqlite3_reset() in the for loop? If I leave it in, the loop keeps running forever since I guess it really does keep resetting the sql statement. Do we need it though inside the while loop when SQLITE_BUSY is returned though? Is that the proper way to try again

Re: [sqlite] starting with unicode

2006-08-15 Thread Nikki Locke
Mark Wyszomierski wrote: >strSql.Format(_T("SELECT * FROM test")); > >sqlite3_stmt *pStmt; >const char *pszTailPointer; >int nRetVal = sqlite3_prepare(db, strSql, strSql.GetLength(), > , ); >if (nRetVal != SQLITE_OK) { >TRACE("prepare fails!! [%i] [%s]\n",

Re: [sqlite] starting with unicode

2006-08-14 Thread Mark Wyszomierski
I suppose this is correct: strSql.Format(_T("SELECT * FROM test")); char szSomething[500]; int nTest = sqlite3_bind_text(pStmt, 1, szSomething, 500, SQLITE_STATIC); if (nTest != SQLITE_OK) { TRACE("sqlite3_bind_text fails!! [%i] [%s]\n", nTest, sqlite3_errmsg(db)); } but can I use the

Re: [sqlite] starting with unicode

2006-08-14 Thread Mark Wyszomierski
John, Cory, thank you very much. I got execute plain statements ok by modifying my earlier posting a bit. I was able to create a table using the prepare statement. Previously I was using sqlite3_exec() to execute my statements and I could pass it a callback function which I could use to fetch

Re: [sqlite] starting with unicode

2006-08-14 Thread John Stanton
Mark Wyszomierski wrote: Hi Cory, Alright I gave it a shot from the docs but I'm not handling the prepare statement correctly. I'm trying the ASCI version first. The prepare statement returns an error. Here is the code snippet I'm trying: strSql.Format("CREATE TABLE test (something TEXT,

Re: [sqlite] starting with unicode

2006-08-14 Thread Mark Wyszomierski
Hi Cory, Alright I gave it a shot from the docs but I'm not handling the prepare statement correctly. I'm trying the ASCI version first. The prepare statement returns an error. Here is the code snippet I'm trying: strSql.Format("CREATE TABLE test (something TEXT, something_else TEXT, primary

Re: [sqlite] starting with unicode

2006-08-13 Thread Cory Nelson
On 8/13/06, Mark Wyszomierski <[EMAIL PROTECTED]> wrote: Hi, I have been using sqlite on windows for a few months, it is great. I need to switch over to unicode support now though, and I am confused how to do this with sqlite. 1) First, when I compiled the original sqlite project, I have the