如下代码一直出错。请大家帮忙检查一下
Form2.SimpleDataSet1.DataSet.CommandText:='INSERT gofix(mainid,paperno,operstate,computeri,computero,printer,cpu,ram,hd,winver,firstpro,secpro,promemo,profix,profixstate,statepj,memo,khqm,fixer,fixyear,fixmonth,godate,synchronism,supervisor) VALUES('+''''+mainid+''''+','+''''+edit14.Text+''''+','+''''+operstate+''''+','+''''+edit1.text+''''+','+''''+edit2.text+''''+','+''''+edit3.Text+''''+','+''''+edit4.Text+''''+','+''''+edit5.Text+''''+','+''''+edit6.Text+''''+','+''''+edit7.Text+''''+','+''''+firstpro+''''+','+''''+secpro+''''+','+''''+edit10.Text+''''+','+''''+edit12.Text+''''+','+''''+profixstate+''''+','+''''+statepj+''''+','+''''+edit11.Text+''''+','+''''+edit13.Text+''''+','+''''+combobox1.Text+''''+','+''''+inttostr(yy)+''''+','+''''+inttostr(mm)+''''+','+''''+datetostr(datetimepicker1.Date)+''''+','+''''+'0'+''''+','+''''+'0'+''')';
Form2.SimpleDataSet1.Execute;
错误提示SQL错误8114。查资料是日期数据不符,但是我已经转换了啊。请大家看看怎么回事。
Form2.SimpleDataSet1.DataSet.CommandText:='INSERT gofix(mainid,paperno,operstate,computeri,computero,printer,cpu,ram,hd,winver,firstpro,secpro,promemo,profix,profixstate,statepj,memo,khqm,fixer,fixyear,fixmonth,godate,synchronism,supervisor) VALUES('+''''+mainid+''''+','+''''+edit14.Text+''''+','+''''+operstate+''''+','+''''+edit1.text+''''+','+''''+edit2.text+''''+','+''''+edit3.Text+''''+','+''''+edit4.Text+''''+','+''''+edit5.Text+''''+','+''''+edit6.Text+''''+','+''''+edit7.Text+''''+','+''''+firstpro+''''+','+''''+secpro+''''+','+''''+edit10.Text+''''+','+''''+edit12.Text+''''+','+''''+profixstate+''''+','+''''+statepj+''''+','+''''+edit11.Text+''''+','+''''+edit13.Text+''''+','+''''+combobox1.Text+''''+','+''''+inttostr(yy)+''''+','+''''+inttostr(mm)+''''+','+''''+datetostr(datetimepicker1.Date)+''''+','+''''+'0'+''''+','+''''+'0'+''')';
Form2.SimpleDataSet1.Execute;
错误提示SQL错误8114。查资料是日期数据不符,但是我已经转换了啊。请大家看看怎么回事。
(title_id, title, type, pub_id, price)
VALUES ('BU9876', 'Creating Web Pages', 'business', '1389', '29.99')
----------
''''+profixstate+'''' //可以用 QuotedStr(profixstate)代替
在DEBUG看看变量,在到数据库中运行看看SQL语句哪里错了。