<< Click to Display Table of Contents >> Navigation: Apollo VCL Components > Apollo VCL Component Reference > TApolloQuery > TApolloQuery Methods > Open |
Declaration
Procedure Open;
Description
Sends the expression in the SQL property to the server to be executed and returns a result set. Same as setting the Active property to True.
Delphi Example
In the example ButtonClick event code below, the SELECT syntax the user enters into the memo window (Memo1) might look something like this:
SELECT first, last, age, hiredate FROM test WHERE (last = "Smith") and (age = 90)
// Open SELECT statement
procedure TForm1.btnSelectClick(Sender: TObject);
begin
try
Screen.Cursor := crSQLWait;
ApolloQuery1.Close;
ApolloQuery1.SQL.Clear;
ApolloQuery1.SQL.Add( edSelect.Text );
ApolloQuery1.Open;
finally
Screen.Cursor := crDefault;
end;
end;
C++Builder Example
ApolloQuery1->SQL->Text = "SELECT First, Last, Age FROM Test WHERE (Age > 50)";
ApolloQuery1->Open();
// . . . do something . . .
ApolloQuery1->Close();
See Also
ActiveTApolloQuery_Active, ExecSQLExecSQL, Apollo SQL Overview!JumpID(`APOLLOSQL.HLP',`ApolloSQL_Overview')