MS SQL Server - "incorrect syntax near" error.

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

MS SQL Server - "incorrect syntax near" error.

Post by ertank » Wed 02 Nov 2016 10:21

Hi,

Using Delphi 10.1 Update 1, UniDAC 6.4.14, MS SQL Server 2012 64bit.

Below is my table structure:

Code: Select all

CREATE TABLE kurlar(
	tarih date NOT NULL,
	kur nvarchar(10) NOT NULL,
	da float NULL,
	ds float NULL,
	ea float NULL,
	es float NULL,
	ckusd float NULL,
	ckdiger float NULL,
	serbest float NULL,
 CONSTRAINT [PK_kurlar] PRIMARY KEY CLUSTERED 
(
	tarih ASC,
	kur ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
I have below SQL which is dislpayed on a DBGrid with Editing allowed.

Code: Select all

select tarih, kur as "Döviz Cinsi", da as "Döviz Alış", ds as "Döviz Satış", ea as "Efektif Alış", es as "Efektif Satış", Serbest as "Serbest Piyasa"
from kurlar 
where tarih = :tarih
I can edit *any* column directly in the grid. When automatically posting (when changing records by arrow keys) I get subject error. Depending on field data type error displayed as:
- Incorrect syntax near "NVARCHAR"
- Incorrect syntax near "FLOAT"

Sample project and sample database backup file including records can be found in below link:
record_edit.7z

I appreciate any solution as I need to fix that pretty fast.

Thanks.

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: MS SQL Server - "incorrect syntax near" error.

Post by ertank » Wed 02 Nov 2016 23:10

I confirm that same error exists in UniDAC 6.4.15

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: MS SQL Server - "incorrect syntax near" error.

Post by ViktorV » Thu 03 Nov 2016 10:58

Thank you for the information. We have reproduced the issue in the Direct Mode and investigation is in progress. We will inform you when we have any results. As a workaround, you can use the standard OLEDB Provider or SQL Native Client Provider. To do this, the UniConnection.SpecificOptions.Values['Provider'] in 'prSQL' or 'prNativeClient' respectively.

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

Re: MS SQL Server - "incorrect syntax near" error.

Post by azyk » Fri 04 Nov 2016 11:45

We have reproduced the described issue and now we are working on its fixing. As soon as the issue is fixed, we will notify you about it and send you a night build with this fix.

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

Re: MS SQL Server - "incorrect syntax near" error.

Post by azyk » Thu 17 Nov 2016 14:07

We fixed this issue. This fix will be included in the next UniDAC build. If you want to get it before the next UniDAC build release, please send the RAD Studio version you are using to andreyz*devart*com and we will send you a night build.

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: MS SQL Server - "incorrect syntax near" error.

Post by ertank » Tue 22 Nov 2016 17:56

Problem fixed at 6.4.16 version.

Thanks.

Post Reply