Page 1 of 1

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

Posted: Fri 08 Jul 2005 14:56
by Ludek
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.

Posted: Mon 11 Jul 2005 08:38
by Ikar
Add as a first parameter to TMSConnection.ConnectString Provider=SQLOLEDB.1;

Posted: Mon 11 Jul 2005 09:29
by Ludek
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?

Posted: Mon 11 Jul 2005 10:50
by Ikar
> Only to be sure - is it safe to set this "Provider" parameter on all stations,
> also on that without this new MDAC?

Yes

Posted: Mon 26 Feb 2007 14:45
by Ludek
hi,
with provider=sqlncli.1 both seem to work ok. I hope, all other functions in the program will also work... :roll:
thanks!