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 :)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.