If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > SQL-Update dBase-table with Delphi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
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 07:55.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On