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 > Database Server Software > Informix > TMemoField using Delphi7

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-04, 17:06
tarcisio tarcisio is offline
Registered User
 
Join Date: Feb 2004
Posts: 2
TMemoField using Delphi7

I have a field CHAR(500) in a Informix table. When I mapped this field in a TClientDataset the type is TMemoField. When I use the applyupdate in this TClientDataset, I have the error : "Record not found or changed by another user". I'm using the ProviderFlags True for the pfInUpdate and pfInWhere.

If I set False to pfInUpdate for this field I don't have the error, but, of course, the value is not saved in the database.

What I need to do ?
Reply With Quote
  #2 (permalink)  
Old 03-10-04, 20:22
Scoee Scoee is offline
Registered User
 
Join Date: Mar 2004
Location: Sydney
Posts: 20
I think this might be a Delphi issue.

The dataset that is writing to the database (usually table, query or update component) has a updatemode property. Try setting this to "upWhereKeyOnly" and make sure the key fields are available to the dataset, ie in the original query etc.
Reply With Quote
  #3 (permalink)  
Old 03-12-04, 05:16
athensy athensy is offline
Registered User
 
Join Date: Feb 2004
Posts: 29
Re: TMemoField using Delphi7

Since Delphi would perform the checking for all existing fields before update a record, internally, it would generate a SQL command somewhat as like as the one shown below:

update <table>
set field1 = value1,
field2 = value2,
........
fieldx = valuex
where field1 = old_value1
and field2 = old_value2
and ............
and fieldx = old_valuex

So, just take out the where checking of the memo field would let you update normally. i.e. set pfInWhere to false of the memo field. However, you must take the risk as that field is really updated by another user before you commit your change.

Hope this help,
Athens.


Quote:
Originally posted by tarcisio
I have a field CHAR(500) in a Informix table. When I mapped this field in a TClientDataset the type is TMemoField. When I use the applyupdate in this TClientDataset, I have the error : "Record not found or changed by another user". I'm using the ProviderFlags True for the pfInUpdate and pfInWhere.

If I set False to pfInUpdate for this field I don't have the error, but, of course, the value is not saved in the database.

What I need to do ?
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