Update statements fail when fieldname starts with digit

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
uberbach
Posts: 9
Joined: Tue 22 Sep 2009 10:50

Update statements fail when fieldname starts with digit

Post by uberbach » Mon 28 Sep 2009 09:17

Using DbxSda driver version 4.45.0.18, I cannot execute update statements when at least one fieldname starts with a digit. An older driver that I have (3.10.8.0) has no problem with it, because it puts quotes around the fieldname.

For example the old driver generates:

Code: Select all

update "1fieldname"...
and the new one does

Code: Select all

update 1fieldname

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 29 Sep 2009 08:00

To solve the problem you sould use the TCRSQLConnection component and set the UseQuoteChar parameter, like this:

Code: Select all

CRSQLConnection.Params.Values['UseQuoteChar'] := 'True';

Post Reply