实时错误424 要求对象 这是什么错误啊?!
我照书上写了一段登陆某系统的窗口
其中有一个函数
function verify(userid as string, txtpwd as string) as boolean
dim idinfo as recordset
dim sqlstr as string
sqlstr="select worknumber,password from worker where worknumber='" & worknumber & "'"
set idinfo=coursedb.openrecordset(sqlstr,dbopensnapshot,dbreadonly) ----->这一行出错
if (idinfo.recordcount=0) then
msgbox "无此工号!",,"登陆"
verify=false
else
if (idinfo.fields("password").value=txtpwd) then
verify=true
else
msgbox "密码错!",,"登陆"
verify=false
end if
end if
idinfo.close
end function
vb提示说 实时错误424 要求对象
这是怎么回事啊?
我哪里错了?我是完全按照书上写的啊