You are right, I corrected it but this is not the problem. The problem is coming from only ONE table : LibLogInf. I exported it, destroyed it, re-created it and re-entered the datas the problem always exists ! If I made the same query with just changing the table name there is no problem ! Generaly, I use SqlExpert to create the query, like this I am sure of the syntax, then I copy the query to my assembler program. I removed the index too. Sincerally, I don't understand. I have the last SqLite version too. I made a vacuum, a repair, I re-indexed all the table, no errors found. Is this table too small ?
-----Message d'origine----- From: Bogdan Ureche Sent: Monday, June 13, 2011 3:30 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] A simple SELECT Hello Philippe, My assembler is a bit rusty, but it looks like you perform the jump to @ReadyToGetData when the return code is either SQLITE_ROW or SQLITE_DONE. You should only attempt to get the data when the return code is SQLITE_ROW. Bogdan On Mon, Jun 13, 2011 at 2:47 AM, Moi (Ph RIO Biz) <m...@phrio.biz> wrote: > I encounter a big problem with a simple query. Here is the query > > SELECT LTRIM(RTRIM(_Libelle)) FROM LibLogInf WHERE ((_Index = 3) AND > (_Langue = 1)) > > When I run it from SqLiteExpertPro there is no problem and I get my > result. > Into my program I get a NULL pointer. > > The table is defined like this : > > CREATE TABLE "LibLogInf" ( > [_Index] INTEGER COLLATE BINARY DEFAULT (0), > [_Langue] INTEGER COLLATE BINARY DEFAULT (0), > [_Libelle] VARCHAR(255) COLLATE BINARY, > CONSTRAINT [sqlite_autoindex_LibLogInf_1] PRIMARY KEY ([_Index], > [_Langue])); > > Here is the program code in assembly language : > > SqLite_GetText PROC __hSql:HANDLE,__lpszQuery:LPSTR,__lpszResult:LPSTR > LOCAL _lpSQLStatment:DWord > LOCAL _lpszErrorMessage:LPSTR > > lea edx,_lpszErrorMessage > lea eax,_lpSQLStatment > > mov DWord Ptr [edx],0 > mov DWord Ptr [eax],0 > > INVOKE sqlite3_prepare_v2,__hSql,__lpszQuery,-1,eax,edx > > test eax,eax > jz @Success > > xor eax,eax > > stc > ret > > ALIGN 16 > > @Success : > > INVOKE sqlite3_step,_lpSQLStatment > > cmp eax,SQLITE_ROW > je @ReadyToGetData > > cmp eax,SQLITE_DONE > je @ReadyToGetData > > INVOKE sqlite3_finalize,_lpSQLStatment > > mov edx,__lpszResult > xor eax,eax > mov [edx],eax > > stc > ret > > ALIGN 16 > > @ReadyToGetData : > > INVOKE sqlite3_column_text,_lpSQLStatment,0 > cmp __lpszResult,NULL > jne @CopyString > > xor eax,eax > > stc > ret > > ALIGN 16 > > @CopyString : > > test eax,eax > jnz @Copy > > INVOKE sqlite3_finalize,_lpSQLStatment > > mov eax,__lpszResult > mov Byte Ptr [eax],0 > > xor eax,eax > > stc > ret > > ALIGN 16 > > @Copy : > > INVOKE lstrcpy,__lpszResult,eax > INVOKE sqlite3_finalize,_lpSQLStatment > > mov eax,__lpszResult > > clc > ret > SqLite_GetText ENDP > > Can someone help me ? > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users