| 发表于:2007-10-24 08:57:46 楼主 |
我现在要编译的是一个保存按钮的代码,编译的时候都成功了,但是当录入信息之后点击保存的时候出现了如下错误信息“project project1.exe raised exception class edatabaseerror with message'adoquerylrcxcx:,missing sql property'. ” 希望大家能够帮我分析下啊,代码如下: procedure tjcxxlr.bitbtn4click(sender: tobject); var aq:tadoquery; begin aq:=tadoquery.create(self); if edit2.text='' then begin messagebox(handle,pchar('系列代码不能为空,请输入!'),'提示',mb_ok); exit; end; if edit3.text='' then begin messagebox(handle,pchar('系列名称不能为空,请输入!'),'提示',mb_ok); exit; end; with aq do begin connection:=datamodule1.adoconnection1; sql.clear; sql.add('select cxdm,cxmc from cx where cxdm='''+trim(edit2.text)+''''); open; end; if aq.recordcount <> 0 then begin messagebox(handle,pchar('车系代号重名或代码有重复,不能保存'),'提示',mb_ok); exit; end; aq.close; aq.free; if adoquerylrcxcx.active=false then adoquerylrcxcx.open; with adoquerylrcxcx do begin append; fieldbyname('cxdm').asstring:=edit2.text; fieldbyname('cxmc').asstring:=edit3.text; post; end; adoquerylrcxcx.sql.clear; adoquerylrcxcx.sql.add('select * from cx where cxdm='''+trim(edit2.text)+''''); adoquerylrcxcx.open; end; end. |
|
|
|
|