Blob file read error with SDAC 3.55.0.16 after installation of VS 2005 beta 2

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek

Blob file read error with SDAC 3.55.0.16 after installation of VS 2005 beta 2

Post by Ludek » 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.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 11 Jul 2005 08:38

Add as a first parameter to TMSConnection.ConnectString Provider=SQLOLEDB.1;

Ludek

Post by Ludek » Mon 11 Jul 2005 09:29

Thanks, it works.
Only to be sure - is it safe to set this "Provider" parameter on all stations, also on that without this new MDAC?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 11 Jul 2005 10:50

> Only to be sure - is it safe to set this "Provider" parameter on all stations,
> also on that without this new MDAC?

Yes

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Post by Ludek » Mon 26 Feb 2007 14:45

hi,
with provider=sqlncli.1 both seem to work ok. I hope, all other functions in the program will also work... :roll:
thanks!

Post Reply