Board index » delphi » sqlserver varchar field truncated to 255

sqlserver varchar field truncated to 255

Hi
I have a varchar(2000) field, when I executes a select,
the Query.FieldByName('MyField').AsString truncates the result to 256
in sqlserver (in oracle this doesn't happened)

any suggestion
thanks
Fidel Lagos

 

Re:sqlserver varchar field truncated to 255


Quote
Fidel Lagos wrote:

> I have a varchar(2000) field, when I executes a select,
> the Query.FieldByName('MyField').AsString truncates the result to 256
> in sqlserver (in oracle this doesn't happened)

        Microsoft has not updated their own DB-LIB driver for SQL Server (used
by the BDE) since SQL Server 6.5.  They have decided that anyone who
wishes to use their product access it via OLE-DB (ADO) instead.  If you
want to use all of SQL Server's post-6.5 features, you need to follow
their whim and use ADO in your program.

Quote
> any suggestion

        As a stopgap solution, you can use ODBC via the BDE.  This should make
it much easier to migrate your program.  Over the long haul, you need to
switch DB access tools whenever Microsoft decides that they're going to
abandon their old way of doing things.

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Other Threads