Thread View: comp.lang.pascal.delphi.misc
2 messages
2 total messages
Started by Van Tyghem Sean
Tue, 16 Jan 2001 22:47
sql in delphi
Author: Van Tyghem Sean
Date: Tue, 16 Jan 2001 22:47
Date: Tue, 16 Jan 2001 22:47
30 lines
2242 bytes
2242 bytes
Hello,
I'm working with d5 and paradox db
I have a table with several fields, one of them is a memo field.
The application first searches via a TQuery in a table for the correct record,
displays the memo in a DBmemo, and if I click the update checkbox, I copy it in
a normal memo. There I can modify the text and click a button to actually do the
update of the memo
This is my sql-statement
UPDATE "Table" Table is the name of the table, no alias (directory)
set Memo = :VarMemo Memo is field memo in table
where Int = :VarInt Int is an integer field
This code is in the onclick event of the button
QRY_Update.paramByName('VarMemo').AsMemo:= MEM_Memo.Text;
QRY_Update.paramByName('VarInt').ASinteger:= Number;
QRY_Update.ExecSQL;
Now here is my problem
If I look wats in the table after I did the update, everything is ok, but
after I close the application, no update has been done.
Can anyone show me what I'm doing wrong
Thanx in advance
sean
Re: sql in delphi
Author: Bj�rge S�ther
Date: Tue, 16 Jan 2001 22:55
Date: Tue, 16 Jan 2001 22:55
52 lines
3373 bytes
3373 bytes
"Van Tyghem Sean" <Van.tyghem.sean@uunet.be> skrev i melding
news:3a64cc10.6250067@news.uunet.be...
> Hello,
>
> I'm working with d5 and paradox db
> I have a table with several fields, one of them is a memo field.
> The application first searches via a TQuery in a table for the correct
record,
> displays the memo in a DBmemo, and if I click the update checkbox, I copy
it in
> a normal memo. There I can modify the text and click a button to actually
do the
Why don't you do the modifications in the DBMemo ? That's what DB controls
are for...need to specify RequestLive:=true to be able to do this.
If you want a kind of "cancel" or "undo", set CachedUpdates:=true for your
dataset, and do an ApplyUpdates call when everything is OK (CancelUpdates if
not).
> update of the memo
>
> This is my sql-statement
> UPDATE "Table" Table is the name of the table, no alias
(directory)
> set Memo = :VarMemo Memo is field memo in table
> where Int = :VarInt Int is an integer field
>
>
> This code is in the onclick event of the button
> QRY_Update.paramByName('VarMemo').AsMemo:= MEM_Memo.Text;
> QRY_Update.paramByName('VarInt').ASinteger:= Number;
> QRY_Update.ExecSQL;
>
> Now here is my problem
> If I look wats in the table after I did the update, everything is ok,
but
> after I close the application, no update has been done.
>
> Can anyone show me what I'm doing wrong
You may actually have overwritten the memofield with the unmodified version.
Close the dataset that holds the memo-field, or position at another record
(Paradox locks 1 row at a time) before doing the update call.
Just my 2 cents...;-)
--
Bjoerge Saether
Consultant / Developer
http://www.itte.no
Asker, Norway
bjorgeremovethis@itte.no (remove the obvious)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads