首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > VFP >

求教:必须指定额外函数?如何解决?

2012-03-31 
求教:必须指定额外函数??怎么解决???我有一个表,建了一个表单向表里追加记录(记录录入表单),在单击保存进

求教:必须指定额外函数??怎么解决???
我有一个表,建了一个表单向表里追加记录(记录录入表单),在单击保存进行测试的时候就出现了:"必须指定额外函数".下面将表结构和添加及保存代码贴出来,请高手指点(不知图片传不传得上来).
一,表结构图:


二,出现问题窗口图:



三,添加按钮代码:
thisform.text1.ControlSource=""
thisform.text2.ControlSource=""
thisform.text3.ControlSource=""
thisform.text4.ControlSource=""
thisform.text11.ControlSource=""
thisform.text12.ControlSource=""
thisform.text13.ControlSource=""
thisform.edit1.ControlSource=""
thisform.edit3.ControlSource=""
thisform.text1.Value = thisform.text1.Value +1
thisform.text6.Value = thisform.text6.Value +1

thisform.text3.Value=""
thisform.text4.Value=""
thisform.text5.Value=ALLTRIM(str(YEAR(DATE())))
thisform.text11.Value=""
thisform.text12.Value=""
thisform.text13.Value=3
thisform.edit1.Value=""
thisform.edit3.Value=""
thisform.olecontrol2.visible= .T.

thisform.combo1.Enabled= .T.
thisform.combo2.Enabled= .T.
thisform.combo6.Enabled= .T.

this.Enabled= .f.
thisform.command1.Enabled=.t.
thisform.command2.Enabled=.t.
thisform.commandgroup1.command1.Enabled=.f.
thisform.commandgroup1.command2.Enabled= .f.
thisform.commandgroup1.command3.Enabled= .f.
thisform.commandgroup1.command4.Enabled= .f.
thisform.commandgroup1.command7.Enabled= .f.
thisform.commandgroup1.command5.Enabled= .t.
thisform.commandgroup1.command14.Enabled= .t.
thisform.commandgroup1.command15.Enabled= .t.

四,保存按钮代码:

djh=thisform.text1.Value
dqzh=ALLTRIM(thisform.text2.Value)
dzrz=ALLTRIM(thisform.text3.Value)
dwh=ALLTRIM(thisform.text4.Value)
dtm=ALLTRIM(thisform.edit1.Value)
dbgqx=ALLTRIM(thisform.text11.Value)
drq=ALLTRIM(thisform.text12.Value)
dys=thisform.text13.Value
dgdnd=thisform.text5.Value
dbz=ALLTRIM(thisform.edit3.Value)
INSERT INTO 全部归档文件.dbf(件号,责任者,文号,题名,日期,页数,归档年度,保管期限,全宗号,备注) VALUES (djh,dzrz,dwh,dtm,drq,dys,dgdnd,dbgqx,dbz)
this.Enabled=.f.


thisform.combo1.Enabled= .f.
thisform.combo2.Enabled= .f.
thisform.combo6.Enabled= .f.

thisform.command1.Enabled=.f.
thisform.command2.Enabled=.f.

thisform.commandgroup1.command1.Enabled=.t.
thisform.commandgroup1.command2.Enabled= .t.
thisform.commandgroup1.command3.Enabled= .t.
thisform.commandgroup1.command4.Enabled= .t.
thisform.commandgroup1.command5.Enabled= .f.
thisform.commandgroup1.command6.Enabled= .t.
thisform.commandgroup1.command7.Enabled= .t.

thisform.olecontrol2.visible= .f.


SELECT 机编顺序号,件号,责任者,文号,题名,日期,页数,归档年度,保管期限,全宗号,备注 FROM 全部归档文件.dbf into CURSOR sb ReadWrite

WITH thisform.grid1
  .recordsource= "sb"
  .Column1.width=60
  .Column2.width=40
  .Column3.width=100
  .Column4.width=120
  .Column5.width=750
  .Column6.width=150
  .Column7.width=100
  .Column8.width=150
  .Column9.width=100
  .Column10.width=100
  .Column11.width=100
endwith
thisform.commandgroup1.command14.Enabled= .F.
thisform.commandgroup1.command15.Enabled= .F.

 thisform.text1.Controlsource="sb.件号"
 thisform.text2.Controlsource="sb.全宗号"
 thisform.text3.Controlsource="sb.责任者"
 thisform.text4.Controlsource="sb.文号"
 thisform.text5.Controlsource="sb.归档年度"
 thisform.text11.Controlsource="sb.保管期限"
 thisform.text12.Controlsource="sb.日期"
 thisform.text13.Controlsource="sb.页数"
 thisform.edit1.Controlsource="sb.题名"
 thisform.edit3.Controlsource="sb.备注"


thisform.grid1.RecordSource="sb"
GO bottom
thisform.Refresh

[解决办法]
INSERT INTO 全部归档文件.dbf(件号,责任者,文号,题名,日期,页数,归档年度,保管期限,全宗号,备注) VALUES (djh,dzrz,dwh,dtm,drq,dys,dgdnd,dbgqx,dbz)
前面10个字段,后面添加的值才9个,缺少"全宗号"的值。
改为:
INSERT INTO 全部归档文件.dbf(件号,责任者,文号,题名,日期,页数,归档年度,保管期限,全宗号,备注) VALUES (djh,dzrz,dwh,dtm,drq,dys,dgdnd,dbgqx,dqzh,dbz)

热点排行