Hello Folks,
Like every year I receive a new Delphi version as SA owner and this is what I do :
- Install delphi version XX.
- Run delphi version XX
- Insert a TSQLConnection component.
- Connect it to a Microsoft SQL Server 2000 who will be with us at least for six more years.
- Insert a TSQLQuery with a 'select top 1 * from myTable' which is a table with some money fields.
- insert more components TDatasetProvider, TClientdataset, TDatasource, TDBGrid and a TButton.
- Link everything.
- Create An event handler in the DatasetProvider.OnUpdateError with a Raise exception.
- A clientdataset1.applyupdates(0); in the button1click.
- make some changes in the current record.
- Press the button1 and get the same exception provided by delphi 2005 and above.
- Renew my corelab or devArt dbx driver for MsSQLServer.
Seriously now. I found some years ago that TDatasetprovider is generating a very simple error: The TFMTBCDField (representation of money field in Delphi) produces incompatible insert/update sql commands for SQL Server 2000 and previous versions. The problem is simple the dataset provider produces quoted values for money fields which are not accepted for those sql servers.
Example: a table with a varchar field and a money field. You can use an update like this:
UPDATE testtable set MYMONEYFIELD = '1' where MYVARCHARFIELD = 'A'
for previous versions of SQLServer you need to use:
UPDATE testtable set MYMONEYFIELD = 1 where MYVARCHARFIELD = 'A'
Someone has any workaround for this issue?