AdoQuery

xiaoxiao2021-03-06  17

// ***************** Contact database part **************************** Procedure TFORM1.BITBTN1CLICK (Sender : TOBJECT); Begin if od1.execute1 begin if od1.execute1 begin if od1.filename <> 'TENBEGIN Edit1.text: = = od1.filename; acon.close; aconnectionstring: =' provider = microsoft.jet.Oledb.4.0; Data Source = ' od1.FileName '; Persist Security Info = False '; try acon.Connected: = true; edit1.Color: = clwhite; combobox4.Items.Clear; acon.GetTableNames (combobox4.Items, false); sb1 .Simpletext: = 'Database link successfully! '; bitbtn3.enabled: = true; comboBox4.itemindex: = 0; listbox1.items.clear; at1.close; at1.tablename: = combobox4.text; at1. ipen; combobox1.items.clear; at1.GetfieldNames (ComboBoX1 .items); ComboBoX1.itemindex: = 0; Except Edit1.color: = CLRED; sb1.simpletext: = 'Database Link Failed! '; ComboBox4.Items.clear; Bitbtn3.enabled: = false; end; end; end; end; // *********************** **************************** Procedure TFORM1.bitbtn3Click (Sender: Tobject); Begin ComboBox4.Items.clear; Acon.gettablenames (ComboBox4.items, False); End; Procedure TForm1.ComboBox4Change (Sender: TObject); begin if combobox4.ItemIndex> = 0 then begin at1.Close; at1.TableName: = combobox4.Text; at1.Open; combobox1.Items.Clear; at1.GetFieldNames (combobox1.items) ComboBOX1.ItemIndex: = 0; ComboBoX1change (nil); end; end; // ************************************************************************************************** ******************** //****************carried out*********** ******************************** Procedure TFORM1.Bitbtn2Click (sender: TOBJECT); begin if listbox1.items.count <> 0 Then Begin aq1.sql.clear AQ1.SQL.Add (listbox1.tems.text); aq1.open; form2.showmodal; end else begin if comboBOX4.TEXT <> '

转载请注明原文地址:https://www.9cbs.com/read-41604.html

New Post(0)