Error querying/updating 'tinyint' fields in SQL Server Compact

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 querying/updating 'tinyint' fields in SQL Server Compact

Post by jeremyw » Wed 19 Mar 2014 22:15

I just found what I'm guessing is yet another conflict resulting from trying to query or update a specific field type (tinyint) using parameterized SQL.

The following code is sufficient to cause an issue:

Code: Select all

Command->SQL->Text = "INSERT [TableName] ( [TinyIntField] ) VALUES ( :TinyIntValue )";
Command->Params->Items[0]->Value = 1;
Command->Execute();
I get the same exception error message I've seen previously in similar situations:
Requested conversion is not supported. [,,,,,]
I've also explored other alternatives, introducing different combinations of the following code, but with the same result:

Code: Select all

Command->Params->Items[0]->DataType = ftByte;
Command->Params->Items[0]->AsByte = 1;
Command->Params->Items[0]->AsInteger = 1;
Note that I only see this error with SQL Server Compact, not in SQL Server.

My development environment consists of:
• Windows 7 (64-bit)
• RAD Studio 2010
• MS SQL Server Compact 3.5
• MS SQL Server Express 2008 R2
• SDAC 6.9.17

Here are some of earlier posts where I reported similar issues:
http://forums.devart.com/viewtopic.php?f=6&t=24873
http://forums.devart.com/viewtopic.php?f=6&t=21172

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error querying/updating 'tinyint' fields in SQL Server Compact

Post by AlexP » Thu 20 Mar 2014 11:18

Hello,

Thank you for the information. We have reproduced the problem in SQL Server Compact and will investigate the reasons of such behavior.

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

Re: Error querying/updating 'tinyint' fields in SQL Server Compact

Post by jeremyw » Thu 20 Mar 2014 15:31

Thank you as usual for the prompt response.

Also, given the fact that I've encountered similar issues with parameterized SQL and certain SQL Server Compact data types, it might be worthwhile to conduct a more thorough investigation.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error querying/updating 'tinyint' fields in SQL Server Compact

Post by AlexP » Mon 24 Mar 2014 13:00

Thank you for the information. We will check all the supported types in MS SQL Server Compact and MS SQL Server Express before the next release.

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

Re: Error querying/updating 'tinyint' fields in SQL Server Compact

Post by jeremyw » Tue 20 May 2014 17:44

From the latest release notes (SDAC version 6.10), it looks like this might have been fixed. I just wanted to confirm this before renewing our support plan.

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Error querying/updating 'tinyint' fields in SQL Server Compact

Post by azyk » Thu 22 May 2014 14:15

Hi,

In the current SDAC release, work with the tinyint data type was fixed for SQL Server Compact.

Post Reply