Board index » delphi » VarChar fields > 255 chars

VarChar fields > 255 chars

I have been trying to make use of the MS SQL Server 7.0 enhancement which
allows you to have Varchar fields of up to 8000 characters. However, when I
try to update the field, it corrupts the data into what appear to be various
formatting characters (e.g.: |?d # ).
I am not using cached updates, but hardcoding the SQL statement in my code,
thus:

     with quUpdateData do begin
        if active then close;
        SQL.clear;
        SQL.Add('update ContactMade set ');
        SQL.add('Notes = :notes, status = :status ');
        SQL.add('where ContactMade_ID = :OLD_ContactMade_ID');
        ParamByName('Notes').asString :=
Request.ContentFields.Values['CurrentNotes']
         + '; ' + Request.ContentFields.Values['NewNotes'] + ' '
         + Request.CookieFields.Values['Username'] + ' ' + dateToStr(Date);
        ParamByname('Status').asString :=
Request.ContentFields.Values['radioaction';
        ParamByName('OLD_ContactMade_ID').asInteger :=
StrToInt(request.ContentFields.Values['contactmade_id']);
        ExecSQL;
     end;

Is this something to do with the BDE?

Peter Tickler
ptick...@potato.org.uk

 

Re:VarChar fields > 255 chars


Use a TTable instead.

Jimb

Quote
Peter Tickler <ptick...@potato.org.uk> wrote in message

news:3a34c449_1@dnews...
Quote
> I have been trying to make use of the MS SQL Server 7.0 enhancement which
> allows you to have Varchar fields of up to 8000 characters. However, when
I
> try to update the field, it corrupts the data into what appear to be
various
> formatting characters (e.g.: |?d # ).
> I am not using cached updates, but hardcoding the SQL statement in my
code,
> thus:

>      with quUpdateData do begin
>         if active then close;
>         SQL.clear;
>         SQL.Add('update ContactMade set ');
>         SQL.add('Notes = :notes, status = :status ');
>         SQL.add('where ContactMade_ID = :OLD_ContactMade_ID');
>         ParamByName('Notes').asString :=
> Request.ContentFields.Values['CurrentNotes']
>          + '; ' + Request.ContentFields.Values['NewNotes'] + ' '
>          + Request.CookieFields.Values['Username'] + ' ' +
dateToStr(Date);
>         ParamByname('Status').asString :=
> Request.ContentFields.Values['radioaction';
>         ParamByName('OLD_ContactMade_ID').asInteger :=
> StrToInt(request.ContentFields.Values['contactmade_id']);
>         ExecSQL;
>      end;

> Is this something to do with the BDE?

> Peter Tickler
> ptick...@potato.org.uk

Re:VarChar fields > 255 chars


Quote
>>Is this something to do with the BDE?

BDE relies upon MS  dbLib to interface with SQL 7.

MS is no longer maintaining dbLib.

Therefore, the BDE does not support the enhancements for SQL 7.

You must use ADO for these features.

=Bill

Re:VarChar fields > 255 chars


Never use TTables against a SQL server.  William of TeamB has the correct
solution.

Good luck,
krf

Quote
Jim's News wrote in message <3a34d5d8$1_1@dnews>...
>Use a TTable instead.

>Jimb

Other Threads