【正文】
else strAlias := [ItemIndex]。39。t contain: NOT IN (xx, yy, zz) } begin { Initialize the variables needed to run the query } with ListBox1 do if ItemIndex = 1 then raise (39。t contain: NOT LIKE %xx% } soBlank, { is blank: } soNotBlank, { is not blank: } soInside, { contains only: IN ( xx, yy, zz ) } soOutside)。t start with: NOT LIKE xx% } soEndsWith, { ends with: LIKE %xx } soNoEndsWith, { doesn39。 { String used to construct the query } frmQuery: TResultForm。 var strAlias, { Alias name selected by the user } strTable, { Table name selected by the user } strField, { Field name selected by the user } strValue, { Field Value entered by the user } strWhere, { WHERE clause for the user39。 end。 finally := crDefault。 { Open the table and put a list of the field names in the Fields list box. } 。 { Open the selected table } with ListBox1 do := [ItemIndex]。 begin := crHourglass。 end。, mtError, [mbOK], 0 )。 if 1 then MessageDlg(39。 { target for table list } { Make sure there are tables defined in the alias. If not, show an error。39。s choices are reflected in the list. } 。 { An integer counter variable for loops} begin { Determine the alias name selected by the user } with ListBox1 do strValue := [ItemIndex]。 { Indicates whether or not an alias is local } slParams: TStringList。 var strValue: string。 end。, mtError, [mbOK], 0 )。 if 1 then MessageDlg( 39。 end。 { Populate the alias list } with ListBox1 do begin 。 procedure (Sender: TObject)。 var QueryForm: TQueryForm。 procedure BitBtn2Click(Sender: TObject)。 procedure ListBox1Click(Sender: TObject)。 Memo1: TMemo。 BitBtn2: TBitBtn。 Edit1: TEdit。 ListBox2: TListBox。 Label4: TLabel。 Label2: TLabel。 Label5: TLabel。 PageControl1: TPageControl。 CheckBox1: TCheckBox。 Table1: TTable。 type TQueryForm = class(TForm) BitBtn1: TBitBtn。 例子全部的程序清單如下: unit main。 在執(zhí)行完 語(yǔ)句之后,應(yīng)用程序?qū)?huì)清除數(shù)據(jù)網(wǎng)格 DBGrid1 中的所有內(nèi)容。 程序清單2是用來清除查詢的,其前兩行語(yǔ)句跟程序清單1中的代碼是一樣的。 。 ()。 。 。 end。 。 單擊按鈕 Button2 的事件處理過程為: 程序清單 procedure (Sender:TO