Creating a dynamic TQuery in RAP
Hi,
in RAP I dynamically create a TQuery. I can set the databasename and the SQL
text. But call Open does not work.
{ ------------------ Code ---------------------------}
var
q: TQuery;
begin
q := TQuery.Create(nil);
q.DatabaseName := 'MyDatabase';
q.SQL.Text := 'select something from somewhere';
q.Open; { Here comes the error }
while not q.Eof do
begin
DoSomething;
q.Next;
end;
end;
{ ------------------ End Code ---------------------------}
ReportBuiler 7.04
Delphi 5
--
Regards
Sven Langenkamp
CT Datentechnik GmbH
Eschenstr. 2
D-31582 Nienburg/Weser
Germany
Telefon: +49 [0] 5021 - 9724-15
Telefax: +49 [0] 5021 - 9724-18
http: www.ctdatentechnik.de
e-mail: langenkamp@ctdatentechnik.de
in RAP I dynamically create a TQuery. I can set the databasename and the SQL
text. But call Open does not work.
{ ------------------ Code ---------------------------}
var
q: TQuery;
begin
q := TQuery.Create(nil);
q.DatabaseName := 'MyDatabase';
q.SQL.Text := 'select something from somewhere';
q.Open; { Here comes the error }
while not q.Eof do
begin
DoSomething;
q.Next;
end;
end;
{ ------------------ End Code ---------------------------}
ReportBuiler 7.04
Delphi 5
--
Regards
Sven Langenkamp
CT Datentechnik GmbH
Eschenstr. 2
D-31582 Nienburg/Weser
Germany
Telefon: +49 [0] 5021 - 9724-15
Telefax: +49 [0] 5021 - 9724-18
http: www.ctdatentechnik.de
e-mail: langenkamp@ctdatentechnik.de
This discussion has been closed.
Comments
RAP will recognize all classes registered with Delphi and their published
properties. However their methods are not available. You will need to
create a RAP pass-thru to expose the Open routine of the TQuery.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com