Page 1 of 1
SDAC and FastReport TMSConnection
Posted: Mon 25 Jan 2010 23:36
by Janner
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
Posted: Tue 26 Jan 2010 07:48
by Dimon
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.
Posted: Tue 26 Jan 2010 10:32
by Janner
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
Posted: Wed 27 Jan 2010 08:54
by Dimon
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
Posted: Thu 28 Jan 2010 19:03
by Janner
Thanks for the help
