2007/11/26, Daniel Rincón García <[EMAIL PROTECTED]>: > Hi, I need to capture the FieldValues of a SQLite database into a string > variable. > > If I do it: > > while not dsTest.EOF do > begin > DataToSend := DataToSend + > dsTest.FieldValues ['Code'] + '\' + > dsTest.FieldValues['Name'] + '\' + > dsTest.FieldValues['Address'] + '#';
provided that DataToSend is a string (as I suppose), you should do this: DataToSend := DataToSend + dsTest.FieldByName('Code').AsString; since FieldByName() returns a TField, have a look at the other methods for type casting. There is basically everything: AsInteger, AsBoolean, and so on.. This also explains why your second code happened to work. Now I'll break every netiquette rule and change (partially) subject: To the Great Guys of the lazarus project: I am finishing a medium size project with lazarus + sqlite3, for which I had study and experiment a lot due to the fact that, IMHO, the database tutorial was slightly too quick on the sqlite part. Would you appreciate it if I wrote a tutorial (= commented example) on sqlite3 with basic topics like the one above and the not so trivial date management stuff ? If you don't really care about it, I won't spend time on it; but if you do care, please point me to the instructions for the wiki and/or a tutorial page template....this will be my Christmas present to the Lazarus project. :-) Roberto _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives