Hi again, i have tried your advice of changing line 192 at table.c and it 
didn´t work (it fires an exception). I do not think that the problem is related 
to sqlite3_get_table or sqlite3_free_table source code.
To make sure, i have test it with another simple program (see the source code 
below), that doesn´t make use of the sqlite_x_table stuff and Windows CE 
doesn´t free memory properly (memory only gets freed once the main program has 
exited). Please see the testing code i am using (it is quite simple) 
void CMemoryMDlg::OnButton1() 
{   
   sqlite3 *db;
   char *zErrMsg = 0;
   int rc;
   rc = sqlite3_open("\\articulos.db", &db);
   if( rc ){
       MessageBox(_T("NO"),_T(""),MB_OK);
       sqlite3_free(zErrMsg);
       sqlite3_close(db);
       CDialog::OnCancel();
   }
   rc = sqlite3_exec(db, "select * from ARTIC ;", 0, 0, &zErrMsg);
   if( rc!=SQLITE_OK ){
       sqlite3_free(zErrMsg);
       MessageBox(_T("NO2"),_T(""),MB_OK);
   }
   sqlite3_free(zErrMsg);
   sqlite3_close(db);
}
Thank you in advance,
Eduardo Esteban
---Mensaje original---On March 14, 2006 01:49 pm, [EMAIL PROTECTED] wrote:
> Hello again,
> Thank for your answers:
> first of all thank you who pointed that i should use a close(db) at
> line 17 and call sqlite3_free_table(result) even if there was an
> error, but these solutions didn´t solve my problem (the execution
> code never reached that point because ret value was always
> SQLITE_OK). Do anyone of you work with SQLite on Windows CE?

No, I don't have win ce either.
However, I looked at the sqlite code and there may be a bug.

In SQLite3.3.4 go to:
"src\table.c" line 192 and change "azResult--;"
----changed_from-----------------------------
190 if( azResult ){
191 int i, n;
192 azResult--;
193 if( azResult==0 ) return;
194 n = (int)azResult[0];
----changed_to-----------------------------
190 if( azResult ){
191 int i, n;
192 azResult -= sizeof(char*); <----changed
193 if( azResult==0 ) return;
194 n = (int)azResult[0];

Recompile sqlite and try again.
Let us know if it works.


Automóviles, telefonía, imagen y sonido, belleza... ¡encuentra gratis todo lo 
que necesitas! http://clasificados.wanadoo.es/

Reply via email to