delphi在执行adoquery.post时提示dataset not in edit or insert mode错误代码如下: datasource1.DataSet:=QB; QB.Connection:=zhuchuti.conn; QB.Close; QB.SQL.Clear; Qb.SQL.Text:='select * from gds_discount where goodscode='''+goodsco
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/24 23:43:15
delphi在执行adoquery.post时提示dataset not in edit or insert mode错误代码如下: datasource1.DataSet:=QB; QB.Connection:=zhuchuti.conn; QB.Close; QB.SQL.Clear; Qb.SQL.Text:='select * from gds_discount where goodscode='''+goodsco
delphi在执行adoquery.post时提示dataset not in edit or insert mode错误
代码如下:
datasource1.DataSet:=QB;
QB.Connection:=zhuchuti.conn;
QB.Close;
QB.SQL.Clear;
Qb.SQL.Text:='select * from gds_discount where goodscode='''+goodscode.Text+'''';
Qb.Open;
dbedit1.Text:=QB.fieldbyname('deptcode').AsString;
dbedit2.Text:=QB.fieldbyname('goodscode').AsString;
dbedit3.Text:=QB.fieldbyname('cheapprice').AsString;
dbedit4.Text:=QB.fieldbyname('startdate').AsString;
dbedit5.Text:=QB.fieldbyname('enddate').AsString;
dbedit6.Text:=QB.fieldbyname('starttime').AsString;
dbedit7.Text:=QB.fieldbyname('endtime').AsString;
dbedit8.Text:=QB.fieldbyname('recorddate').AsString;
dbedit9.Text:=QB.fieldbyname('recorder').AsString;
dbedit10.Text:=QB.fieldbyname('approveflag').AsString;
dbedit11.Text:=QB.fieldbyname('checkdate').AsString;
dbedit12.Text:=QB.fieldbyname('checker').AsString;
dbedit13.Text:=QB.fieldbyname('comment').AsString;
dbedit1.Text:=zhuchuti.StatusBar1.Panels[4].Text;
dbedit2.Text:=goodscode.Text;
dbedit3.Text:=cheapprice.Text;
dbedit4.Text:=formatdatetime('yyyy-MM-dd',startdate.Date);
dbedit5.Text:=formatdatetime('yyyy-MM-dd',enddate.Date);
dbedit6.Text:=starttime.Text;
dbedit7.Text:=endtime.Text;
dbedit8.Text:=zhuchuti.StatusBar1.Panels[3].Text;
dbedit9.Text:=zhuchuti.StatusBar1.Panels[1].Text;
dbedit10.Text:='1';
dbedit11.Text:='';
dbedit12.Text:='';
dbedit13.Text:='';
QB.Post;
应该是adoqurey没有处于编辑或插入状态,请问我要在哪里加入QB.exit或QB.insert
delphi在执行adoquery.post时提示dataset not in edit or insert mode错误代码如下: datasource1.DataSet:=QB; QB.Connection:=zhuchuti.conn; QB.Close; QB.SQL.Clear; Qb.SQL.Text:='select * from gds_discount where goodscode='''+goodsco
你对数据库根本没有修改.赋值的时候直接赋给数据库.或者你是不是把方向搞反了..
QB['deptcode']=dbedit1.Text;