W
wxj9527
Unregistered / Unconfirmed
GUEST, unregistred user!
function TMainForm.GetCheckedStr(const checklistbox: TCheckListBox):String;var i:integer;begin Result := ''; for i := 0 to checklistbox.Items.Count-1 do begin if checklistbox.Checked then begin Result := checklistbox.Items.Strings; break; end; end;end;procedure TMainForm.btn_CommitClick(Sender: TObject);var s1,s2:string;begin s1 := GetCheckedStr(clb_source_field); s2 := GetCheckedStr(clb_source_table); with mastdata.ADO_Source do begin Close; SQL.Clear; SQL.Text := 'select '+s1+' from '+s2+' '; Open; showmessage(FieldByName(s1).Asstring); end; //testclb_source_field,clb_source_table是TCheckListBox.为什么报找不到对应的s1字段?