Board index » delphi » String Fields > 255 chars

String Fields > 255 chars

I am using a query with MSSQL Server 7.0 to insert a varchar[300] into a
table which delphi does fine, but when I retrieve the data into delphi
it is truncated at 255 chars.  When I view the field value with SQL
server the entire string is returned so I know it's in there, I just
canty retrieve it.  Any ideas?

Thanks in advance,

Tom

 

Re:String Fields > 255 chars


What version of Delphi / BDE are you using?

Quote
Tom Mueller <muelle...@msx.upmc.edu> wrote in message

news:39D2512F.EFEC49A4@msx.upmc.edu...
Quote
> I am using a query with MSSQL Server 7.0 to insert a varchar[300] into a
> table which delphi does fine, but when I retrieve the data into delphi
> it is truncated at 255 chars.  When I view the field value with SQL
> server the entire string is returned so I know it's in there, I just
> canty retrieve it.  Any ideas?

> Thanks in advance,

> Tom

Re:String Fields > 255 chars


BDE version 5.1.1- the latest.  The interesting part is that if you insert a
string  larger than 255 chars SQL7 stores it no problem so the BDE and the
database are working properly during a write- the problem is in retrieving the
string where it is truncated.  The query tool that comes with SQL 7 uses 255
chars by default during a fetch unless you tell it to use more which is very
odd- who would want to retrieve less than everything stored in a  field? So I
don't know if you have to send a special fetch to SQL 7 to get the entire
field past 255 chars or what- maybe the problem doesn't concern Delphi at all-
maybe it's our friends at MS, very odd but maybe someone else has come across
this behavior.
Quote
"WmBurke(TeamB)" wrote:
> What version of Delphi / BDE are you using?

> Tom Mueller <muelle...@msx.upmc.edu> wrote in message
> news:39D2512F.EFEC49A4@msx.upmc.edu...
> > I am using a query with MSSQL Server 7.0 to insert a varchar[300] into a
> > table which delphi does fine, but when I retrieve the data into delphi
> > it is truncated at 255 chars.  When I view the field value with SQL
> > server the entire string is returned so I know it's in there, I just
> > canty retrieve it.  Any ideas?

> > Thanks in advance,

> > Tom

Re:String Fields > 255 chars


Quote
WmBurke(TeamB) wrote in message <8qu9oj$l...@bornews.borland.com>...
>What version of Delphi / BDE are you using?

Doesn't matter.  It's M$ DBLib that does not support varchar >255.  If you
really need fields that big, then you must use ADO

Good luck,
krf

Re:String Fields > 255 chars


I've done a little testing using ODBC instead of the BDE and it works fine- is
there a known problem with the BDE 5.1.1 or should I reinstall it, maybe mine
is damaged or not complete?
Quote
"WmBurke(TeamB)" wrote:
> What version of Delphi / BDE are you using?

> Tom Mueller <muelle...@msx.upmc.edu> wrote in message
> news:39D2512F.EFEC49A4@msx.upmc.edu...
> > I am using a query with MSSQL Server 7.0 to insert a varchar[300] into a
> > table which delphi does fine, but when I retrieve the data into delphi
> > it is truncated at 255 chars.  When I view the field value with SQL
> > server the entire string is returned so I know it's in there, I just
> > canty retrieve it.  Any ideas?

> > Thanks in advance,

> > Tom

Re:String Fields > 255 chars


I don't think there's any problem with your BDE 5.11 installation.

As Kevin pointed out, the MS DBLib does not support the new datatypes of
MSSQL7. The BDE/SQL Links combination *relies* on MS DBLib to talk to MSSQL.
Of course you have another alternative and that is going through
MSSQL->ODBC->BDE->Delphi Application.

HTH,
Mio Nino Marquez

Re:String Fields > 255 chars


i have met the same problem.i changed the varchar[300] to text type,delphi
query can retrieve the data as Tmemofield,as works properly
Quote
"Tom Mueller" <muelle...@msx.upmc.edu> wrote in message

news:39D2512F.EFEC49A4@msx.upmc.edu...
Quote
> I am using a query with MSSQL Server 7.0 to insert a varchar[300] into a
> table which delphi does fine, but when I retrieve the data into delphi
> it is truncated at 255 chars.  When I view the field value with SQL
> server the entire string is returned so I know it's in there, I just
> canty retrieve it.  Any ideas?

> Thanks in advance,

> Tom

Other Threads