SDAC and FastReport TMSConnection

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Janner
Posts: 4
Joined: Mon 25 Jan 2010 23:31

SDAC and FastReport TMSConnection

Post by Janner » Mon 25 Jan 2010 23:36

Hi,
I have created a script that is attempting to create a TMSConnection. As soon as I open the connection using Fastscript I get the error: Incompatible types: TMSCustomConnection and TMSConnection but obviously this works anywhere else. Any suggestions?

var
MSConnection1 : TMSConnection;
begin
MSConnection1 := TMSConnection.Create(nil);
MSConnection1.ConnectString := 'Provider=SQLOLEDB.1;Data Source=SQL2008;Initial Catalog=TEST;Integrated Security=SSPI';
MSConnection1.Open

Thanks

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 26 Jan 2010 07:48

I can not reproduce the problem.
Please try to compose a small sample to demonstrate the problem and send it to dmitryg*devart*com.

Also supply me the following information:
- the exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- the exact version of FastScript;
- the exact version of your IDE.

Janner
Posts: 4
Joined: Mon 25 Jan 2010 23:31

Post by Janner » Tue 26 Jan 2010 10:32

I am using Delphi 2010 14.0.3615.26342
SDAC 4.80.0.54
and FastScript 1.9.

I have took the demo script in the fastscript demo folder and modified it as follows. The connection opens, the error occures when I try to assign that connection to the MSQuery.

var
DBForm: TForm;
MSConnection1 : TMSConnection;
MSQuery1 : TMSQuery;
DataSource: TDataSource;
Grid: TDBGrid;
begin
DBForm := TForm.Create(nil);
DBForm.SetBounds(100, 100, 400, 400);

MSConnection1 := TMSConnection.Create(nil);
MSConnection1.ConnectString := 'Provider=SQLOLEDB.1;Data Source=SQL2008;Initial Catalog=TEST;Integrated Security=SSPI';
MSConnection1.Open;

MSQuery1 := TMSQuery.Create(nil);
MSQuery1.Connection := MSConnection1; //Error here
MSQuery1.SQL.Text := 'SELECT * FROM TEMP';
MSQuery1.Open;

DataSource := TDataSource.Create(DBForm);
DataSource.DataSet := MSQuery1;

Grid := TDBGrid.Create(DBForm);
Grid.DataSource := DataSource;
Grid.Parent := DBForm;
Grid.Align := alClient;

DBForm.ShowModal;
DBForm.Free;
end.

Thanks

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 27 Jan 2010 08:54

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next SDAC build.

As a temporary solution find the line below in the TFunctions.Create method of the fs_isdacrtti.pas unit:

Code: Select all

    with AddClass(TMSConnection, 'TCustomDAConnection') do begin
and change it to this code:

Code: Select all

    AddClass(TCustomMSConnection, 'TCustomDAConnection');
    with AddClass(TMSConnection, 'TCustomMSConnection') do begin

Janner
Posts: 4
Joined: Mon 25 Jan 2010 23:31

Post by Janner » Thu 28 Jan 2010 19:03

Thanks for the help :D

Post Reply