vfp程序改错(一个修改按钮的代码)

来源:百度知道 编辑:UC知道 时间:2024/06/30 02:16:56
local c as integer
a=alltrim(thisform.Text3.value)
b=alltrim(thisform.Text4.value)
d=alltrim(thisform.Text5.value)
e=alltrim(thisform.Text6.value)
f=alltrim(thisform.Text7.value)
g=alltrim(thisform.Text8.value)
h=alltrim(thisform.Text9.value)

if empty(a).or.empty(b).or.empty(d).or.empty(e).or.empty(f).or.empty(g).or.empty(h)
messagebox("密码等均不可以修改为空值",16,"系统提示")
return
endif
msg=messagebox("确定要修改记录吗?",32+4,"系统提示")
if msg=6
c=recno()
locate for 密码=a
if eof()
go c
replace 帐号.密码 with a
endif
locate for 姓名=b
if eof()
go c
replace 帐号.姓名 with b
ENDIF
locate for 身份证号=d
if eof()
go c
replace 帐号.身份证号 with d
ENDIF
locate for 联系电话=e
if eof()
go c
replace 帐号.联系电话 with e
ENDIF

g=alltrim(thisform.Text8.value)
h=alltrim(thisform.Text9.value)
...
locate for 开通时间=g
if eof()
go c
replace 帐号.开通时间 with g
ENDIF
locate for 到期时间=h
if eof()
go c
replace 帐号.到期时间 with h
ENDIF
你的日期都是字符型的吗?表里的字段和TEXT控件的属性一样吗?

没看出什么来。
你检查一下下面几个有没有类型不符的:
1、【开通时间】/【帐号.开通时间】和【g也就是Text8】
2、【到期时间】/【帐号.到期时间】和【h也就是Text9】
如果表字段是date/datetime型,将会出现你所谓的错误提示