TMSSQL and large geometry as param

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Aufhauser
Posts: 56
Joined: Mon 21 Nov 2005 09:44
Location: Herzogenburg, Austria

TMSSQL and large geometry as param

Post by Aufhauser » Tue 02 Aug 2011 06:32

Sorry, once again my problems with very large geometries.
In the latest versions of SDAC TMSQuery works fine with large geometries, but not TMSSQL.
Whith large geometries (more than 16 KB)

TMSQuery.FieldByName('GEOMETRY).AsBytes:= LargeGeometry
works but
TMSSQL.ParamByName('GEOMETRY').AsBytes:= LargeGeometry
raises an error.
Is this the same bug, which was previous in component TMSQuery?

Stefan

AndreyZ

Post by AndreyZ » Wed 03 Aug 2011 07:26

Hello,

I cannot reproduce the problem. Please try creating a small sample to demonstrate the problem and send it to andreyz*devart*com, including a script to create a table.

Aufhauser
Posts: 56
Joined: Mon 21 Nov 2005 09:44
Location: Herzogenburg, Austria

Post by Aufhauser » Thu 04 Aug 2011 12:52

Sorry, my describtion was too short.

this code works:
MSQuery.Edit;
MSQuery.FieldByName('GEOMETRY).AsBytes:= LargeGeometry;
MSQuery.Post;

same using TMSSQL does not work:

MSSQL.ParamByName('GEOMETRY').DataType:= ftVarBytes;
MSSQL.Prepare;
MSSQL.ParamByName('GEOMETRY').AsBytes:= LargeGeometry;
MSSQL.Execute;

I get the SQLServer exception "unexpected end of file".
SDAC cuts of data which length is more then xxx bytes. For me it is the same bug, which was in SDAC (MSQuery) described in blog "Native Client and large Geometry"

AndreyZ

Post by AndreyZ » Fri 05 Aug 2011 06:54

Thank you for the information. We have fixed this problem. This fix will be included in the next SDAC build. As a workaround, you can use the following code:

Code: Select all

MSSQL.DescribeParams := True;
MSSQL.Prepare; 
MSSQL.ParamByName('GEOMETRY').AsBytes := LargeGeometry; 
MSSQL.Execute;

Aufhauser
Posts: 56
Joined: Mon 21 Nov 2005 09:44
Location: Herzogenburg, Austria

Post by Aufhauser » Mon 08 Aug 2011 09:02

Thank you for information, the program works. You should add description of "DescribeParams" to SDAC help.
Stefan

AndreyZ

Post by AndreyZ » Mon 08 Aug 2011 12:32

We will add a description of the DescribeParams property to the SDAC documentation.

Post Reply