Page 1 of 1

UniConnection SQL Server translate SQL statment

Posted: Fri 02 Nov 2012 12:32
by bn1978
Hello
I try execute this statement
12:22:52 CREATE TABLE AddrLabels ("Name" VARCHAR(35) NULL, "Addr1" VARCHAR(35) NULL, "Addr2" VARCHAR(35) NULL, "City" VARCHAR(35) NULL, "State" VARCHAR(2) NULL, "Zip" VARCHAR(10) NULL, "User" VARCHAR(12) NULL, "DateAdded" DATETIME NULL)

from this code
try
SQLServerConnection.ExecSQL(SQL,[]);
except on E: Exception do
ErrorMsg(E.Message);
end;
and have this error
12:22:53 Incorrect syntax near the keyword 'User'.
SQL profiler show me next statement
CREATE TABLE AddrLabels ([Name] VARCHAR(35) NULL, [Addr1] VARCHAR(35) NULL, [Addr2] VARCHAR(35) NULL, [City] VARCHAR(35) NULL, [State] VARCHAR(2) NULL, [Zip] VARCHAR(10) NULL, [User] VARCHAR(12) NULL, [DateAdded] DATETIME NULL)
can I tune connection, execute statement without [] brackets ?

Win7 64 UniDac 4.1.4 Rad Studio XE2
Thanks

Re: UniConnection SQL Server translate SQL statment

Posted: Fri 02 Nov 2012 13:33
by AndreyZ
Hello,

I have executed the following code:

Code: Select all

UniConnection1.ExecSQL('CREATE TABLE AddrLabels ("Name" VARCHAR(35) NULL, "Addr1" VARCHAR(35) NULL, "Addr2" VARCHAR(35) NULL, "City" VARCHAR(35) NULL, "State" VARCHAR(2) NULL, "Zip" VARCHAR(10) NULL, "User" VARCHAR(12) NULL, "DateAdded" DATETIME NULL)', []);
, and there were no problems. Please try using the latest UniDAC version 4.5.9 and check if the problem persists. If it does, please specify the exact version of SQL Server you are using. You can learn it from the Info sheet of TUniConnection Editor.