E
eulb
Unregistered / Unconfirmed
GUEST, unregistred user!
我用ADO连接Access数据库,并想用sql添加一条记录,代码如下
procedure TForm1.Button3Click(Sender: TObject);
begin
with ADOCommand1 do
begin
CommandText:='INSERT INTO '+
' tablePROXY(ID,IP地址:,端口,202段有效,151段有效,129段有效)'+
'VALUES (4,:IP,ort,true,true,true)';
ADOCommand1.Parameters.ParamValues['IP']:=editIP.Text;
ADOCommand1.Parameters.ParamValues['Port']:=editPort.Text;
CommandType:=cmdText;
ADODataSet1.Recordset:=Execute;
end;
end;
可运行总出错:"ADODataSet1:RecordSet is not open",我加上ADOCommand1.Open也没用
,这是什么原因?谢谢指教
procedure TForm1.Button3Click(Sender: TObject);
begin
with ADOCommand1 do
begin
CommandText:='INSERT INTO '+
' tablePROXY(ID,IP地址:,端口,202段有效,151段有效,129段有效)'+
'VALUES (4,:IP,ort,true,true,true)';
ADOCommand1.Parameters.ParamValues['IP']:=editIP.Text;
ADOCommand1.Parameters.ParamValues['Port']:=editPort.Text;
CommandType:=cmdText;
ADODataSet1.Recordset:=Execute;
end;
end;
可运行总出错:"ADODataSet1:RecordSet is not open",我加上ADOCommand1.Open也没用
,这是什么原因?谢谢指教