Results 1 to 1 of 1
  1. #1
    Join Date
    Dec 2003
    Posts
    1

    Error SQL-Update dBase-table with Delphi

    Hi,
    I am a new user to this forum, so please forgive my newbie-faults...
    Recently i am (re)developing a Delphi-app which amongst other things is updating dBase-tables with SQL.
    The records however are not updated. Instead the original record is deleted (DELETED() = .T.) and a new record with the updated values is added to the table. The number of records is thus increasing. Other applications may find the wrong record, the one with the DELETED-sign until i apply the native dBase-command PACK.
    The SQL-code:
    active := false;
    sql.clear;
    sql.add('update voorraad set ');
    sql.add('kastloc = "' + trim(Artikel.Kastloc) + '"');
    sql.add(', artomslang = "' + trim(Artikel.artomslang) + '"');
    sql.add(', artvoor = ' + inttostr(Artikel.Artvoor));
    sql.add(', artomschr = "' + trim(Artikel.artomschr) + '"');
    sql.add(', syncdatum = "' + formatdatetime('MM"/"DD"/"YYYY',date) + '" ');
    sql.add(' where artnummer = "' + trim(Artikel.Artnummer) + '"');
    prepare;
    ExecSQL;
    active := false;

    Versions:
    Delphi 5.62, app is running on Win98 SE-desktop
    dBase IV (table is residing on a Novell 4.1 server, Alias via BDE)

    Any ideas whats going wrong?

    Thanks in advance!

    Joop
    Last edited by JoopTvS; 12-18-03 at 08:55.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •