Problem with Float Field

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
RobertjanTuit
Posts: 2
Joined: Wed 07 Sep 2005 13:08

Problem with Float Field

Post by RobertjanTuit » Wed 07 Sep 2005 13:13

Hi,

I recently bought de DBExpress MYsql Drivers for Delphi.

I'm aom now having a problem when using datasetprovider.ApplyUpdates(0);
and a float Field with another value then NULL

The error it gives is :
"unable to find record. No key specified"

This happens only when the start Value is NOT NULL and NOT an rounded number, so when the start value has decomal numbers the update failed to whatever you try to change it.

Do you hav any idea what could be the problem ?

Withg Regards,
Robertjan Tuit

Using :
Delphi 7
mysql-server-4.1.10a-1

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 07 Sep 2005 15:48

If on modification or deletion the record the list of fields of WHERE clause has FLOAT fields, for example TSQLClientDataSe.UpdateMode = upWhereAll, the query can refresh no records. The cause of the problem is that FLOAT fields are stored on the server with low precision and couldn't be correctly compared with passed value.

RobertjanTuit
Posts: 2
Joined: Wed 07 Sep 2005 13:08

Post by RobertjanTuit » Thu 08 Sep 2005 09:19

Ok I Understand,

Now i changed updateMode = upWhereKey,
I have a table with primary Key and have selected this primary key in the select.

I'm using tSQLQUery btw.

It gives another error now : "unable to find record. No key specified"
Even when i remove the Float Field from the select list.

Should i enter the Primary Key Somewehere the the DataSetPrivder or the TSQLQuery ?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 08 Sep 2005 14:40

Do you have unique key fields in your query? If not then try to add them or set pfInKey flag in fields ProviderFlag property

Post Reply