TIBCQuery result fields are read-only

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
RedOctober2013
Posts: 9
Joined: Thu 02 May 2013 22:52

TIBCQuery result fields are read-only

Post by RedOctober2013 » Thu 02 May 2013 23:11

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.

RedOctober2013
Posts: 9
Joined: Thu 02 May 2013 22:52

Re: TIBCQuery result fields are read-only

Post by RedOctober2013 » Thu 02 May 2013 23:35

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

Post by AndreyZ » Wed 08 May 2013 08:31

It's good to see that you have found a solution. If you have any other questions about IBDAC, please contact us.

Post Reply