Thierry Andriamirado escreveu:
Le lundi 15 mai 2006 à 14:21 -0300, Luiz Americo a écrit :

Editing in the TDbGrid does not call the sqlite database, so SqlitereturnString has no meaning. SqliteReturnString only has a meaning after calling ExecSql, Open, CreateTable etc functions.

TSqliteDataset does not handle unique, not null constraints of all fields automatically. The programmer must do yourself using OnValidate event.

ah... it seemed to me that SqliteReturnString allways return the good
value, i.e 'SQLITE_CONSTRAINTS' when there's constraints problems,
SQLITE_OK when all right and so on... I understood it as if
TSqliteDataset only received the error message from the sqlite3 engine,
because the database file contains indices with unique constraints. So
your advice is NOT to check SqliteReturnString when editing in the
dbgrid,
Yes
because it can return a wrong value?
No. TSqliteDataset keeps the edited/added data in a buffer and only send this data when ApplyUpdates is called. When editing in TDbGrid only the data in the buffer changes and no comunication is done to sqlite. So the sqlite engine is not aware of the data that is being edited in TDbGrid and SqliteReturnString is out of context. Anyway is better, when appropriate, to check SqliteReturnId property instead of SqliteReturnString it will return one of the integer constants (SQLITE_OK etc) found in sqlite3 unit.
Luiz

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to