Blob file read error with SDAC 3.55.0.16 after installation of VS 2005 beta 2
Posted: Fri 08 Jul 2005 14:56
Hi,
I cannot read long text fields (longer than 1024 characters - exact: 1024 works well, 1025 no more) from database after installation of Visual Studio 2005 beta 2 and it's new MDAC. The field gets corrupted - it includes a copy of itself at the end and seems to be somewhat longer than the stored value... is something known about it? this code demonstrates:
program texttest;
{$APPTYPE CONSOLE}
uses
SysUtils, MSAccess, ActiveX;
var
c: TMSConnection;
q: TMSQuery;
txtconst: string;
begin
txtconst := stringofchar('A', 1025);
CoInitialize(nil);
c := TMSConnection.Create(nil);
try
c.Server := 'hiwdb';
c.Database := 'ludektest';
c.Username := 'sa';
c.Password := 'masterkey';
c.Open;
try
q := TMSQuery.Create(nil);
try
q.Connection := c;
q.SQL.Text := 'delete from texttest';
q.Execute;
q.SQL.Text := 'insert into texttest (txt) values (:txt)';
q.ParamByName('txt').AsString := txtconst;
q.Execute;
q.SQL.Text := 'select txt from texttest';
q.Open;
try
if q.FIeldByName('txt').AsString = txtconst then
writeln('OK')
else begin
writeln('FAILED!');
writeln(q.FieldByName('txt').AsString);
end;
finally
q.Close;
end;
finally
q.Free;
end;
finally
c.Close;
end;
finally
c.Free;
end;
readln;
end.
after installation of VS2000B2 I get FAILED. the texttest is a simple table with one column of type text.
Any ideas? thanks.
I cannot read long text fields (longer than 1024 characters - exact: 1024 works well, 1025 no more) from database after installation of Visual Studio 2005 beta 2 and it's new MDAC. The field gets corrupted - it includes a copy of itself at the end and seems to be somewhat longer than the stored value... is something known about it? this code demonstrates:
program texttest;
{$APPTYPE CONSOLE}
uses
SysUtils, MSAccess, ActiveX;
var
c: TMSConnection;
q: TMSQuery;
txtconst: string;
begin
txtconst := stringofchar('A', 1025);
CoInitialize(nil);
c := TMSConnection.Create(nil);
try
c.Server := 'hiwdb';
c.Database := 'ludektest';
c.Username := 'sa';
c.Password := 'masterkey';
c.Open;
try
q := TMSQuery.Create(nil);
try
q.Connection := c;
q.SQL.Text := 'delete from texttest';
q.Execute;
q.SQL.Text := 'insert into texttest (txt) values (:txt)';
q.ParamByName('txt').AsString := txtconst;
q.Execute;
q.SQL.Text := 'select txt from texttest';
q.Open;
try
if q.FIeldByName('txt').AsString = txtconst then
writeln('OK')
else begin
writeln('FAILED!');
writeln(q.FieldByName('txt').AsString);
end;
finally
q.Close;
end;
finally
q.Free;
end;
finally
c.Close;
end;
finally
c.Free;
end;
readln;
end.
after installation of VS2000B2 I get FAILED. the texttest is a simple table with one column of type text.
Any ideas? thanks.