[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 807
  • Last Modified:

BDE TQuery reading a SQL Server VarChar(500)


I previously posted this same question in the wrong section so I apologize if you read this post twice.

I have a Table on SQL Server having a VarChar(500) field.  When I query this table using a TQuery component, it only returns the first 255 characters from the 500 char field.

I tried the same thing with TADOQuery object and it worked fine, all 500 char were returned.

I HAVE to use a TQuery object (I cannot switch to a TADOQuery).

Can anyone help me with this ?

Thanks :)
1 Solution
you might want to check the BDE configuration, at the BLOB SIZE property, either increase that or set it to -1 and see if that works
qasAuthor Commented:
Hi :)

Setting the BlobSize property to -1 gave me an error ("Invalid or out of range dboption parameter").  Setting it to 1024 did not solve my problem.  Still have a 255 char field instead of 500.

Any hint ?
I think by reading it as TMemoField, it might work as well?
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

or as a TBlobField...
qasAuthor Commented:
Thanks for the comments.

How do I tell a TQuery to read the field as a TMemoField ?

When I open the query it automatically creates a TStringField.

Thanks again :)
qasAuthor Commented:
Ok I got it.

I added a new field and gave it the same name as the field from table.  I tried TMemoField, TWideStringField and TBlobField.  I always get a Type Mismatch Exception.

Any more hint ?
I think the problem is that you are using SQL Server native drivers. They are based on DBLibrary, which goes way back to SQL Server 1.0. Up to SQL Server 6.5 (or 7, I forget which), the biggest varchar you could have was 255. DBLibrary is still supported, but I seem to remember it's for backward compatibility only, in other words, it will only handle old datatypes.

Try going via an ODBC connection instead of using the BDE SQL Server driver.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now