tags:

views:

680

answers:

1

Hello, I am writing a program that uses master / detail I am new to Zeos and SQlite I already have the conection, two tables, etc. I have an autoincrement primary key field on the master table I want to update. What should I do to automatically retrieve the primary key field value (and the record pointer stays on the record I have just created) so that value can be used for de detail table.

I get the following error:

Project Kaizen_2009.exe raised exception class EZSQLException with message 'SQL Error: SQL logic error or missing database'. Process stopped. Use Step or Run to continue.

Thanks in advance

Alejandro Jourdan

+1  A: 

The most straight forward way is using a SQL statement -> SELECT LAST_INSERT_ROWID().

Also, there is a TZSequence that should do the same - But I can't tell you for sure if it supports SQLite. Check the demo folder on your Zeos Lib installation. Specifically the ZSimple folder.

Alan Fletcher