E
esgeht
Unregistered / Unconfirmed
GUEST, unregistred user!
请问下面的SQL语句有什么错误?可以编译通过
但一执行这个插入操作就报错
ADOConnection1.open;
ADOQuery1.close;
with ADOQuery1 do begin
with SQL do begin
Clear;
Add('insert into tbl_histWeather');
Add('values('''+datetostr(date)+''',''+trackbar2.Position+'',''+trackbar1.Position+'',''+trackbar3.Position+'',');
Add('''+trackbar4.position+'',''未知'','''+radiogroup1.items[radiogroup1.itemindex]+''',');
Add('''+trackbar5.position+'','''+radiogroup2.items[radiogroup2.itemindex]+''',');
Add(''''+radiogroup3.items[radiogroup3.itemindex]+''','''+radiogroup4.items[radiogroup4.itemindex]+''','''+radiogroup5.items[radiogroup5.itemindex]+''',');
Add(''''+edit1.Text+''')');
end;
ExecSQL;
end;
ADOConnection1.Close;
ADOQuery1.close;
ADOQuery1.active:=false;
但一执行这个插入操作就报错
ADOConnection1.open;
ADOQuery1.close;
with ADOQuery1 do begin
with SQL do begin
Clear;
Add('insert into tbl_histWeather');
Add('values('''+datetostr(date)+''',''+trackbar2.Position+'',''+trackbar1.Position+'',''+trackbar3.Position+'',');
Add('''+trackbar4.position+'',''未知'','''+radiogroup1.items[radiogroup1.itemindex]+''',');
Add('''+trackbar5.position+'','''+radiogroup2.items[radiogroup2.itemindex]+''',');
Add(''''+radiogroup3.items[radiogroup3.itemindex]+''','''+radiogroup4.items[radiogroup4.itemindex]+''','''+radiogroup5.items[radiogroup5.itemindex]+''',');
Add(''''+edit1.Text+''')');
end;
ExecSQL;
end;
ADOConnection1.Close;
ADOQuery1.close;
ADOQuery1.active:=false;