On Sun, 26 Feb 2006, Luiz Americo Pereira Camara wrote:

> Luiz Americo Pereira Camara escreveu:
> > Bogus?aw Brandys escreveu:
> >> Hello,
> >>
> >> First: I'm using FPC SVN 2.0.3 from 2006-02-24 TSqlite3Dataset version.
> >> I know that there is some version newer then this but I'd like to
> >> stick with SVN.
> >> Platform: Windows XP Home,Lazarus SVN rev.8817
> >>
> > I already sent a patch to fpc maillist. I'm waiting for the commit.
> >> Why is impossible to use Edit,Post,ApplyUpdates,Refresh functions
> >> for TSqlite3Dataset in SQLMode ? I have defined PrimaryKey which is
> >> INTEGER PRIMARY KEY but is it skipped (for example ApplyUpdates has
> >> check for :
> >>   if (FPrimaryKeyNo <> -1) and not FSqlMode then (...)
> >> )
> >>
> >> So that code does not update database table at all (in SQLMode):
> >>
> >> DB.Edit;
> >> DB.FieldByName('Test').AsString := 'Test';
> >> DB.Post;
> >> DB.ApplyUpdates;
> >> DB.Refresh;
> >>
> >>
> >> For me it's strange because update/delete SQL should work flawless
> >> with SQlMode when PrimaryKey is set (even if table has not define
> >> primary key there is ROWID variable to obtain record ID which may be
> >> used for update/delete statement)
> >>
> > SqlMode is intended only when you want to use queries that retrieves
> > data from more than one table or use field aliases. It prevines data
> > corruption when using ApplyUpdates. When using queries that retrieve
> > data from only one table, without using aliases, even complex ones,
> > ApplyUpdates will work and SqlMode should be set to false. Notice that
> > only ApplyUpdates is affected by SqlMode. All other functions you
> > cited does not.
> >
> I will remove the SqlMode property since it will cause a lot of
> confusion like this and in fact it does not prevent calling ApplyUpdates
> in the cited situation. I'll make clear in the documentation (when it's
> done) that ApplyUpdates will not work in queries with fields of more
> then one table. I already have planned to extend ApplyUpdates to work
> with such queries but no time yet.

Maybe it's easier to revert your component to SQLDb.

SQLDB has a working ApplyUpdates, even for queries
with fields of more than one table.
You would then also have parameter support and so on.

Michael.

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

Reply via email to