Beta 3.0 SQL Server ReadOnly problem

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
CarlosBenito
Posts: 7
Joined: Tue 13 Jun 2006 15:49

Beta 3.0 SQL Server ReadOnly problem

Post by CarlosBenito » Thu 10 Sep 2009 12:10

Hi,

We are using TClientDataSet and sometimes, for display purposes, we must modify some of the field values on client site without changing them in database (the field is returned in the query with a 0). I can´t edit this field in the TClientDataSet in SQL Server with the error: "Field "FieldName" cannot be modified".

With Oracle (UniDac) or the DevArt dbexpress (Oracle and SQL Server) it works fine.

In this case TUniQuery does not use any UpdateSQLs.

I have tried SetFieldsReadOnly := False but the field has ReadOnly = True;

I set ReadOnly := False to the field but when I do a ClientDataSet.Post I have the error "Trying to modify read-only field".

I set ProviderFlags := [] to the field but it does not make any difference.

How i can ignore the update of a ReadOnly field to edit a TClientDataSet in SQL Server without a SQLUpdate?

Thanks a lot.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 11 Sep 2009 11:41

In the current UniDAC version there is no way to make a field not read-only.

The SetFieldsReadOnly option is related to fields that have corresponding fields in the database but belong to a table other than UpdatingTable. This option does not affect fields based on expressions.

Try to use a calculated field instead of assigning a value to a normal field.

CarlosBenito
Posts: 7
Joined: Tue 13 Jun 2006 15:49

Post by CarlosBenito » Mon 14 Sep 2009 13:11

Is there a logical reason to change the behavior in UniDac SQL Server?

With your Oracle and SQL Server dbexpress drivers and UniDac Oracle it works!

This is my last problem to change my application to UniDac (from dbexpress).

Is there another solution? It´s very difficult to change my app with calculated fields...

Thanks a lot

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 15 Sep 2009 09:21

Oracle provider does not detect the fields based on expressions. So it does not set ReadOnly for them.

In the next UniDAC version we will change the behaviour of SetFieldsReadOnly property. So there will be no ReadOnly fields when this property is False.

CarlosBenito
Posts: 7
Joined: Tue 13 Jun 2006 15:49

Post by CarlosBenito » Tue 15 Sep 2009 12:16

Thank you!

I will wait then.

Post Reply