I have the following code:
Code: Select all
var
dsi: TDataSetInfo;
begin
dsi.UNI := TUniTable(grd.DataSource.DataSet);
dsi.UNIConnection := con;
dsi.SQL := SQL;
if not SKAInitDataSet(dsi) then
...
...
end;
Function OpenDataSet(dsi: TDataSetInfo): Boolean;
begin
Result := True;
if dsi.UNI.Active then
dsi.UNI.Close;
dsi.UNI.Connection := dsi.UNIConnection;
dsi.UNI.SQL.Clear;
dsi.UNI.SQL.Add(dsi.SQL);
try
if not dsi.UNIConnection.Connected then
dsi.UNIConnection.Connect;
dsi.UNI.Open;
except
on E: Exception do
ShowMessage(E.Message);
end;
end;
dsi.UNI.Open;
It runs into the
on E: Exception do
with an AV message.
I have the components on a TDataModule and when i activate them there, they run just fine.
Can anyone please tell me what i am missing in opening a TUniTable in code?
TIA