Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

ADO and QueryWinzard

edited October 2004 in General
Hi,

I need to work with ADO and QueryWinzard.
I try with this code but not work.
Help me please.
Thanks.

procedure ShowQueryWizard;
var connection: TStringList;
FSQL: TdaSQL;
FSession: TdaADOSession;
lDialog: TdaQueryDesignerForm;
begin
try
connection := TStringList.Create;
connection.LoadFromFile(ExtractFilePath(Application.exename) +
'connection.tmp');
FSession := TdaADOSession.Create(Nil);
FSession.GetDefaultADOConnection.ConnectionString := connection.Text;
FSQL := TdaSQL.Create(Nil);
FSQL.Session := FSession;
FSQL.AllowSelfJoin := True;
FSQL.DatabaseType := dtMSAccess;

lDialog := TdaQueryDesignerForm.Create(Nil);
lDialog.SQLClass := TdaSQL;
lDialog.SQL.Assign(FSQL);
lDialog.Initialize;
ldialog.AllowEditSQL := true;
if (lDialog.ShowModal = mrOK) then begin
FSQL.Assign(lDialog.SQL);
end;
finally
lDialog.Free;
FSession.Free;
FSQL.Free;
FSession := Nil;
FSQL := Nil;
connection.Free
end;
end;

Comments

This discussion has been closed.