Board index » delphi » varchar>255 and collate DE_DE

varchar>255 and collate DE_DE

Hello,

I use Delphi 5 c/s and Delphi 6 enterprise and Interbase 6.0.1 on
Windows 2000. The following error oocurs in delphi 5 and delphi 6.

I have a db with two tables (created in SQL dialect 1 and Character
set set to ISO8859_1:

create table test (
ID integer not null,
feld1 varchar(255),
feld2( varchar(2000),
primary key (ID))

create table test1 (
ID integer not null,
feld1 varchar(255) collate DE_DE,
feld2( varchar(2000) collate DE_DE,
primary key (ID))

In both tables there is a record with ID=1 and feld1 and feld2 are
filled with the maximum length of characters (could be done with
Butto1.Click). Button2.Click do the select.

If I d the select on table test all works fine. If I do the select on
table t1 (the one with collate DE_DE) Interbase reports a strange
error:
"Unable to complete network request to host "localhost". Error reading
data from the connection. An existing conection was cancelld from the
host-computer by software"

After that error I have to stop the interbase-service and start it
again to bring interbase back to live.

This seems to be a serious bug. Could anyone reproduce it and have a
solution for it?

Thanks

Stefan Westner

My delphi-code looks like (D1 is my TDatabase and S1 my TQuery):

procedure TForm1.Button1Click(Sender: TObject);
begin
  D1.Open;
  S1.SQL.Clear;
  S1.SQL.Add('insert into test1 (ID, feld1, feld2) values (:ID,
:feld1, :feld2)');
  S1.ParamByName('ID').AsInteger:=1;
  S1.ParamByName('feld1').AsString:=

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+
  '123456789012345678901234567890123456789012345';
  S1.ParamByName('feld2').AsString:=

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'+

'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890';
  D1.StartTransaction;
  S1.ExecSQL;
  D1.Commit;
  D1.Close;
end;

procedure TForm1.Button2Click(Sender: TObject);
var i: Integer;
    f1, f2: String;
begin
  Memo1.Clear;
  D1.Open;
  S1.SQL.Clear;
  S1.SQL.Add('select distinct ID, feld1, feld2 from test1');
  D1.StartTransaction;
  S1.Open;
  i:=S1.FieldByName('ID').AsInteger;
  f1:=S1.FieldByName('feld1').AsString;
  f2:=S1.FieldByName('feld2').AsString;
  Memo1.Lines.Add('i='+IntToStr(i));
  Memo1.Lines.Add('feld1='+f1);
  Memo1.Lines.Add('feld2='+f2);
  D1.Commit;
  D1.Close;
end;

 

Re:varchar>255 and collate DE_DE


Quote
Stefan Westner wrote:

> Hello,

        Multi-posted, answered elsewhere.

        Please do not multi-post.  By multi-posting you are asking folks
in
this newsgroup to waste their time on a question which has already been
answered.  You're also violating Borland's rules for the use of their
servers, which you can read here:

http://www.borland.com/newsgroups/guide.html

        In the future, please choose a single newsgroup for your
question.

        Thank you,

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Other Threads