if combobox.text='南京' then begin try query.sql.text:='insert into 表 values(''01'')'; query.exsql; finally query.close; end;
if combobox1.text='河南' then begin ShowMessage('ok'); try adoquery1.sql.text:='insert into systab (countdays) values(''01'')'; adoquery1.Execsql; finally adoquery1.close; showmessage('ok1'); end; 我就是照上面这个方法写的 也能编译通过 可就是存进去的不是想要写的01 而是以前的数据 复制了一遍, 这是什么原因呀
ComboBox1.Clear; for i:=0 to ADOQuery1.FieldCount-1 do ComboBox1.Items.Add(ADOQuery1.Fields[i].FieldName);
if ComboBox1.Text:= '南京' then temp := '01'; AdoCommand1.Text := 'insert into yourTable(Field1) value (:p1)' ; AdoCommand1.Parameters.ParamByName('CustId').Value := temp ; AdoCommand1.Execute;
begin
try
query.sql.text:='insert into 表 values(''01'')';
query.exsql;
finally
query.close;
end;
begin
ShowMessage('ok');
try
adoquery1.sql.text:='insert into systab (countdays) values(''01'')';
adoquery1.Execsql;
finally
adoquery1.close;
showmessage('ok1');
end;
我就是照上面这个方法写的 也能编译通过 可就是存进去的不是想要写的01 而是以前的数据
复制了一遍, 这是什么原因呀
ComboBox1.Clear;
for i:=0 to ADOQuery1.FieldCount-1 do
ComboBox1.Items.Add(ADOQuery1.Fields[i].FieldName);
temp := '01';
AdoCommand1.Text := 'insert into yourTable(Field1) value (:p1)' ;
AdoCommand1.Parameters.ParamByName('CustId').Value := temp ;
AdoCommand1.Execute;
怎么办呢
(;p1)什么意思呢
编译时
[Error] Unit1.pas(115): Undeclared identifier: 'Text'
怎么办