Well, sorry to hear that.

I tested the function:

<code>
vector<vector<string> >  CSGDb::query(char* query, sqlite3 *database)
{
        sqlite3_stmt *statement;
        vector<vector<string> > results;

        if(sqlite3_prepare_v2(database, query, -1, &statement, 0) == SQLITE_OK)
        {
                int cols = sqlite3_column_count(statement);
                int result = 0;
                while(true)
                {
                        result = sqlite3_step(statement);
                        
                        if(result == SQLITE_ROW)
                        {
                                vector<string> values;
                                for(int col = 0; col < cols; col++)
                                {
                                        std::string  val;
                                        char * ptr = 
(char*)sqlite3_column_text(statement, col);
                                        if(ptr)
                                        {
                                            val = ptr;
                                        }
                                        else val = "";

                                        values.push_back(val); 
                                }
                                results.push_back(values);
                        }
                        else
                        {
                                break;   
                        }
                }

                sqlite3_finalize(statement);
        }
              
        return results;
}
</code>
  
and it works for me fine.

Could you print the value of val before it is pushed to the values vector?  Of 
course the problem is not Sqlite problem but the proper usage of STL.


----- Original Message ----
From: Chimerian <chimer...@o2.pl>
To: sqlite-users@sqlite.org
Sent: Sun, March 7, 2010 4:23:30 PM
Subject: Re: [sqlite] Problem with SQLite in BCB 4

Unfortunately it still doesn't work. I have error in line values.push_back(val);
I tried to run program on Windows XP - I have this same error.

Links to error screens:
http://chimerian.net/error1.jpg
http://chimerian.net/error2.jpg


      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to