Register TSQLConnection in tool palette

Using RadStudio Berlin Enterprise
Scripter Mar-2017 (7.7)

Running the ScripterProIDE project, I see how to register the data controls and ADO controls for use in the tool palette.

I'm trying to do the same to introduce TSQLConnection, TSQLDataSet, TDataSetProvider, and TClientDataSet into the scripter IDE

I've found  ap_DBClient and ap_Provider which appear as though they  give me access to TClientDataset and TDataSetProvider, but I don't see anything in imports folders that references TSQLConnection or TSQLDataSet.


TSQLConnection is in Data.SQLExpr.

When I tried the ImportTool on this file, I received an error on ",nodefault" below:


 protected  { publish in TSQLDataSet }
    property CommandType: TSQLCommandType read FCommandType write SetCommandType default ctQuery;
    [Stored('IsDbxCommandTypeStored'), nodefault]
                                     ^ error here



Am I just missing something here? Is there an ap_SQLExpr equivalent I just can't find?

If not, how might I import this successfully? Can I mix an import from DelphiBerlin with the code that exists in imports\delphixe7?

TIA.


ap_SQLExpr is not included, imported files are mostly the ones common to all Delphi versions, and SQLExpr was not present in early Delphi editions. With the new RTTI being released years ago (Delphi 2010), the importance of import tool has been strongly reduced.


You can register that class much easier with 

Scripter.DefineClassByRtti(TSQLConnection);

and then manually tweak the missing methods/properties, if needed. It's the preferred way to import  Delphi classes into TMS Scripter these days.

Thanks Wagner...

For anyone else, here's how I got TSQLConnection working:

Add to "uses": Data.SqlExpr,  Data.DbxOdbc,


procedure TForm1.FormCreate(Sender: TObject);
begin
 IIDEScripter1.DefineClassByRTTI(TSQLConnection, roInclude, true);
 IDEScripter1.DefineClassByRTTI(TDBXOdbcDriverLoader, roInclude, true);

 With IDEEngine1 do
  begin
    BeginRegisterComponents;
    try
      RegisterComponent('dbExpress',     TSQLConnection, 'DB');
    finally
      EndRegisterComponents;
    end;
  end;
end;



When I run the IDE, I can pick a form and drop a TSQLConnection on it. Very nice.

From object inspector, when I look at SCN params, nothing there.

When I change DriverName to 'ODBC' and look at params, the correct values are there:


DriverUnit=Data.DBXOdbc
DriverPackageLoader=TDBXOdbcDriverLoader,DBXOdbcDriver240.bpl
DriverAssemblyLoader=Borland.Data.TDBXOdbcDriverLoader,Borland.Data.DbxOdbcDriver,Version=24.0.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b
MetaDataPackageLoader=TDBXOdbcMetaDataCommandFactory,DbxOdbcDriver240.bpl
MetaDataAssemblyLoader=Borland.Data.TDBXOdbcMetaDataCommandFactory,Borland.Data.DbxOdbcDriver,Version=24.0.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b



I had to manually add to params:


Database=MYDSN 
User_Name=aUSER
Password=aPWD



And it connected.

I haven't tested anything but  Open and  OnAfterConnect at the moment.

EdB