I'm migrating a project from Delphi 7 to Delphi XE3. I used to use dbExpress, now I'm using IBC by DevArt. I have figured out how to replace my old dbExpress TSQLQuery components with the TIBCQuery components (connecting them to a TIBCConnection now) and I can retrieve data into my TClientDataSet. All is well up to that point. However, I find that I cannot use my usual field update methods that I used to. Here is my old code:
(cds = TClientDataSet)
cdsApt.Edit;
cdsAptEML_SENT.AsDateTime := Now; <--- Error here now
cdsApt.Post;
cdsApt.ApplyUpdates(0);
I get an error at the line indicated, saying that the field cannot be updated.
I do not have anything in the SQLUpdate property of the TIBCQuery because in dbExpress, the TDataSetProvider would generate that automatically. I also noticed that there is a property called "SetFieldsReadOnly" which was True and I set it to False, but I still get the same error. The query I'm using pulls from about 6 different tables, so in the provider I made a "OnGetTableName" and set to the appropriate table name.
---------------------------
Debugger Exception Notification
---------------------------
Project myproject.exe raised exception class EDatabaseError with message 'Field 'EML_SENT' cannot be modified'.
---------------------------
Break Continue Help
---------------------------
Is there something else I need to do to get this to work correctly?
Thanks in advance for any help you can provide.
TIBCQuery result fields are read-only
-
RedOctober2013
- Posts: 9
- Joined: Thu 02 May 2013 22:52
Re: TIBCQuery result fields are read-only
Answered my own question.... I had to recreate the EML_SENT field as there was a type difference between the old and new. The ReadOnly property on the newly created field was set to True, so I set it to False and it is working correctly now. Heads up for anyone else doing a conversion of this type.
-
AndreyZ
Re: TIBCQuery result fields are read-only
It's good to see that you have found a solution. If you have any other questions about IBDAC, please contact us.