線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:812
推到 Plurk!
推到 Facebook!

Small question about TADOQuery

尚未結案
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-04-08 01:54:23 IP:217.34.xxx.xxx 未訂閱
Please correct me if I am making a wrong statement below: If a ADOQuery is Active, the SQL String in it will be running everytime. If a ADOQuery is Unactive, Type: ADOQuery,ExecSQL to will make the SQL String execute 'ONCE ONLY' If a ADOQuery is Unactive. ADOQuery.Active := True; will turn it on forever. (obviously) Please correct me if I have said anything wrong
timhuang
尊榮會員


發表:78
回覆:1815
積分:1608
註冊:2002-07-15

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-04-16 01:00:12 IP:61.221.xxx.xxx 未訂閱
If a ADOQuery is Active, the SQL String in it will be running everytime. Active -> Meaning the dataset is opened but not running, then sql command is sent once. If a ADOQuery is Unactive, Type: ADOQuery,ExecSQL to will make the SQL String execute 'ONCE ONLY' execsql function and open procedure are both send sql command once!! If a ADOQuery is Unactive. ADOQuery.Active := True; will turn it on forever. (obviously) set dataset active := true is the same to dataset.open !!
// the source of dataset.open from db unit
procedure TDataSet.Open;
begin
  Active := True;
end;
execsql is used to execute sql commands are 'update', 'insert', 'delete', open is used to get records from databse, the sql commands are 'select'. Both these two procedures are send the sql command once to DBMS. Execsql gets no records, just send sql command, but Open get records. --- DELPHI on-line help --- Call Open to set the Active property for the dataset to True. When Active is True, data can be populated with data. It can read data from a database or other source (such as a provider). Call ExecSQL to execute the SQL statement currently assigned to the SQL property. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE). Note: For SELECT statements, call Open instead of ExecSQL or set the Active property to True.
系統時間:2024-07-02 7:08:16
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!