一个使用adoquery的出错的例子,请告诉我出错的原因(求教)
if edit1.text='' then exit;
adoquery1.ConnectionString :='Provider=Microsoft.Jet.OLEDB.4.0;Data Source= '+ ExtractFilePath(Application.Exename) + 'data\data.mdb;' ;
adoquery1.SQL.Clear ;
adoquery1.Close ;
s:= 'select * from qz where 群组=''' +edit1.text+'''' ;
adoquery1.SQL.Add(s);
adoquery1.Open ;
i:=adoquery1.RecordCount ;
adoquery1.SQL.Clear ; //出错的地方,我使用的是5.0 为什么会出错?
adoquery1.Close ;
if i<1 then
begin
s:= 'insert into qz(群组) values('''+ edit1.text+''')' ;
adoquery1.SQL.Add(s);
adoquery1.ExecSQL ;
form2.ComboBox1.Items.Add (edit1.text);
form4.Close ;
end ;
end;