2010/3/6 Chimerian <[email protected]>:
> I have a problem with SQLite in BCB 4.0. I wrote my own application -
> I found very useful information on
> http://www.dreamincode.net/forums/index.php?showtopic=122300
>
> On form (Form1) I have: Memo1 and Button3.
>
> File Unit1.cpp:
> <code>
>
.
.
.
.> for(int col = 0; col < cols; col++)
> {
>
> values.push_back((char*)sqlite3_column_text(statement, col));
> // HERE IS ERROR !
What error?
I can not see why THIS line should provoke any error; but be aware
that you are creating a vector of INVALID pointers. The return from
sqlite3_column_text is not valid after subsequent calls to any of
sqlite3_step/sqlite3_reset/sqlite3_finalize.
You need to make a copy of the string and store that, not the pointer
returned from sqlite3_column_text.
> }
> results.push_back(values);
> }
> else
> {
> break;
> }
.
.
.
> How to fix it ?
See above (possibly)
>
> I have Borland Builder 4 Standart and Windows 7. I use 3.6.22 version
> of SQLite.
>
> Link to my project (comments in polish): http://chimerian.net/4prog.rar
>
>
Regards,
Simon
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users