type TForm1 = class(TForm) BitBtn1: TBitBtn; ADOConnection1: TADOConnection; procedure BitBtn1Click(Sender: TObject); private public end;
Type TAdoExec = Class(TThread) Private Public Protected Procedure Execute; Override; End;
var Form1: TForm1;
implementation
uses ActiveX;
{$R *.dfm}
{ TAdoExec }
procedure TAdoExec.Execute; begin Inherited; ActiveX.CoInitialize(Nil); Try With TADOQuery.Create(Nil) Do Begin ConnectionString := 'Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TEST;Data Source=.'; SQL.Add('Select * From Tree'); ExecSQL;
请发表评论