TSQlite3dataset problem with "count(*)"-query lazarus / 16-Databases ---------------------------------------------------------------------- speedbur · 2006-03-03 19:49 hi.. i have a minor problem with the TSQlite3dataset. I have a simple test table (only with an id and a varchar field). Normal select queries are working fine, but if i using a query with a count(*), max(id), ... an exeption is being raised. =( normal select Code: [Select]      dsTest := TSQLite3Dataset.Create(nil);       dsTest.FileName := '/pub/test.sqlite';       dstest.SqlMode := true;       dsTest.SQL := 'select name AS anz from test';       dstest.Open;           dsTest.First;       while not dstest.EOF do         begin writeln(dstest.FieldValues['anz']);               dstest.Next;         end;             dstest.Close;       dstest.Free;   output: Code: [Select]bla bla2 asd bxcbwsr qerdvssdvc asd3123 query with count(*) Code: [Select]      dsTest := TSQLite3Dataset.Create(nil);       dsTest.FileName := '/pub/test.sqlite';       dstest.SqlMode := true;       dsTest.SQL := 'select count(*) AS anz from test';       dstest.Open;           dsTest.First;       writeln(dstest.FieldValues['anz']);       dstest.Close;       dstest.Free; output: Code: [Select]An unhandled exception occurred at $080870F0 : EDatabaseError :  : Field type "" not recognized   $080870F0   $0809A31F   $080B2B4F   $08088B60   $08089523 *edit* i think there is a bug in the TSqlite3Dataset class. if you have a table, that returns a value that is not a column in a databasetable the call ColumnStr:= UpperCase(StrPas(sqlite3_column_decltype(vm,Counter))); didn't return anything else than an empty string best regards Hendrik ---------------------------------------------------------------------- LuizAmérico · 2006-03-06 21:24 Already fixed. Get it here: http://www.geocities.com/camara_luiz/sqlite4fpc/index.html Luiz ---------------------------------------------------------------------- speedbur · 2006-03-07 13:41 ok thanks. i'll try it later ---------------------------------------------------------------------- redge · 2006-03-13 22:46 I try today with the 0.9.12, and i have the same exception  "Field type "" not recognized"  when i make a select  that returns a value that is not a column in a databasetable. The TSqlite*Dataset of your site doesn't seem to fix the problem. What I have to do? Thanks. Redge ---------------------------------------------------------------------- Anonymous · 2006-03-13 23:46 Please read this topic: http://www.lazarus.freepascal.org/index.php?na me=PNphpBB2&file=viewtopic&t=2001 ---------------------------------------------------------------------- redge · 2006-03-15 20:55 thanks for the quick answer. I read the topic. I'm a newbie and i try  to do since yesterday but i fail... I'm on win 32 : I use lazarus 0.9.12 ( install with :Lazarus-0.9.12-20060207-win32.exe) I think this release build with FPC 2.0.2. ( I try too with 0.9.13 beta, the today's  snapshot ). I download the last  TSqlite*Dataset and Lazarus Package from http://www.geocities.com/camara_luiz/sqlite4fpc/index.html. In C:\lazarus\components\sqlite, I delete all the files and i copy the " lazarus package". In C:\lazarus\fpcsrc\fcl\db\sqlite\ i replace  the 3 *.pas with the file of  "TSqlite*Dataset". I build this file in lazarus with menu>run>buid file and i deplace the *.o and *.ppu file to C:\lazarus\pp\units\i386-win32\fcl I install sqlite3laz.lpk, build lazarus and try with a simple test (the same of this topic ). The same exception appears. I think , i do something wrong but what ? I don't want to waste your time, but where can i find documentation ? Or what can i do ? redge. ---------------------------------------------------------------------- LuizAmérico · 2006-03-26 13:01 It seems that you have the old sqlite binaries (*.ppu;*.o) in the fpc path. Try the folowing:  1) Delete all files inside C:\lazarus\components\sqlite\lib  2) Delete customsqliteds, sqlite3ds and sqliteds (ppu and o) of C:\lazarus\pp\units\i386-win32\fcl  3) Put the new source files inside C:\lazarus\components\sqlite  4) Compile the package and install it This will work if you use fpc through Lazarus. It will not work if you use the command prompt. Luiz ---------------------------------------------------------------------- redge · 2006-04-01 21:30 Ok, i tried : but no. What a pity ! when i install the new package, the SQL MODE disappear of the object inspector. is it normal ? ---------------------------------------------------------------------- LuizAmérico · 2006-04-02 22:31 QuoteOk, i tried : but no. What a pity ! Please send an example to me, or upload here, with the problem you having Quotewhen i install the new package, the SQL MODE disappear of the object inspector. is it normal ? Yes. SqlMode was an unecessary property Luiz