Locating a record in SQLite database (from code) lazarus / 16-Databases ---------------------------------------------------------------------- idealis · 2011-11-29 12:45 Hi! I am working on this project that uses a simple SQLite database. As I need training in SQL, I wrote this string: Code: [Select]SELECT AliPer FROM Registros WHERE CUIT = 'xxxxxxxxxxx' I have set up a TSqlite3Dataset variable and tried using ExecSQL(). It doesn't throw errors, but I don't know how (where) to fetch the result! I know this is probably a noob question, but my searches on the Web were unsuccessful... Can you help me? Thanks! ---------------------------------------------------------------------- BigChimp · 2011-11-29 12:51 Almost there. ExecSQL runs SQL, true, but it is meant for instructions that don't return results (e.g. INSERT INTO, running stored procedures etc). Instead, use the query's Open method to retrieve results. See the various database tutorials on the wiki (I like SQLDB Tutorial1 - having added stuff to it myself  ) Good luck BTW: How did you do the conversion from DBF to SQLite - did you use some kind of tool? ---------------------------------------------------------------------- idealis · 2011-11-29 17:11 Thanks, BigChimp. I'll be sure to take a look. Sorry, I actually made a conversion from TXT to SQLite, wrote myself a small program... But I could easily convert from DBF to SQLite as well just by changing the input module. It's a prototype though - It worked,  saved 1,7M records in ~2 hours, but still needs some work