Error inserting float values into real fields via parameters

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jeremyw
Posts: 32
Joined: Thu 29 Apr 2010 17:32

Error inserting float values into real fields via parameters

Post by jeremyw » Thu 02 Jun 2011 17:26

I've run into an error trying to insert float values into fields with an underlying type of real using parameterized SQL INSERT commands. Upon executing the command, an exception is thrown saying "Unknown BLOB field type", even if no BLOB fields exist within the table. I've been able to reproduce this issue within a simple demo app that I would be happy to forward along.

I can trigger this with code as simple as this:

Code: Select all

Command->SQL->Text = "INSERT [TableName] ( [ValueReal] ) VALUES ( :ValueReal )";
Command->Params->Items[0]->Value = float(3.14);
Command->Execute();
My development environment consists of:
• Windows 7 (64-bit)
• RAD Studio 2010
• MS SQL Server Compact 3.5 (also occurs within MS SQL Server)
• SDAC 4.80.0.58

AndreyZ

Post by AndreyZ » Fri 03 Jun 2011 07:38

Hello,

To avoid this problem, you should use the following code:

Code: Select all

Command->Params->Items[0]->AsFloat = float(3.14);

jeremyw
Posts: 32
Joined: Thu 29 Apr 2010 17:32

Post by jeremyw » Wed 15 Jun 2011 16:46

As always, I appreciate the quick response, and I apologize for my own delay. I've been out on vacation.

Unfortunately, the code provided does not solve the problem. A different error message is generated saying "Requested conversion is not supported [,,,,,]".

AndreyZ

Post by AndreyZ » Thu 16 Jun 2011 09:45

Thank you for the information. We have reproduced this problem and fixed it. We are going to release a new SDAC version today, and we cannot include this fix in it. That's why this fix will be included in the next nearest SDAC build. Also note that you will have to use the following code:

Code: Select all

Command->Params->Items[0]->AsSingle = 3.14;

jeremyw
Posts: 32
Joined: Thu 29 Apr 2010 17:32

Post by jeremyw » Thu 16 Jun 2011 15:39

Awesome, I'm glad you guys were able to address the issue so quickly. I don't think we have support anymore, however, so will we have to renew our support plan to get this fix?

AndreyZ

Post by AndreyZ » Fri 17 Jun 2011 06:42

If your subscription isn't expired then you can upgrade SDAC to the latest version freely. When you buy SDAC you receive a registration mail where you can find a link, username, and password for Registered Users' Area ( http://secure.devart.com ). If there is no link in Registered Users' Area to download the latest SDAC version, it means that your subscription is expired and you need to renew it. You can renew your subscription here (in the Subscription Renewals section): http://www.devart.com/sdac/ordering.html

Post Reply