Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit on varchar size returned by BDE/ODBC

Status
Not open for further replies.

350Zed

Programmer
Aug 30, 2007
13
0
0
GB
Hi,

C++ Builder 6.0 Enterprise
BDE Admin 5.01
XP SP3
Ingres 9.3/Oracle 10g

I have a DB query which is being displayed in a DBGrid. This used to previously run against Oracle 10g with no problem. I'm now trying to get it to work with Ingres, and I'm having trouble with varchars.

If the length of the varchar exceeds 255 it's being returned as a memo field so in my DBGrid all I get is "(MEMO)" and not the text. As far as Ingres is concerned the max length of a varchar is 32000 so the problem isn't there, (as far as I can tell), so it must be in the ODBC/BDE/C++ communication somewhere. (I think!)

I cant find any settings in the BDE Admin or ODBC Admin screens that would suggest a limit on the varchar length.

The field in question is created by concatenating several table columns together, and it is the total length of the column sizes and not the data returned that is effecting the switch from varchar to memo. (The query actually returns the first 80 chars, but the column sizes add up to 1000 chars.)

Are there any settings somewhere that will change this cut over from varchar to memo?
or
How do I get it to display the content of the memo and not just "(MEMO)" on the screen? (The DBGrid is populated by assigning the table column from the query so I cant use object->text or object->value to get it.)
or
Is it possible to override the data types the DBGrid is using and assign my own?

Thanks.
 
I am not sure if I understand well what you wish. However I should solve this by adding a TDBMemo to my DBGrid, in a way that each time a record is selected, the context of the text will displayed in the TDBMemo.
 
I also had the same issue - the only way to fix that was to convert the column to smaller varchar:

convert(varchar(128), col1+col2 + ... + coln)

This is on msssl/sybase. There might be some ODBS/BDE seeting, but i doubt that ....
I hope this helps
 
Sorry for the delay in responding, had my priorities shifted to a different project for a while.

Using a cast in the query seems to have done the trick.

Thanks for the replies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top