Object variable not set 0

kgd198294 2005-01-31 05:33:33
'检查并创建邮件数据库
Set mailDb = New notesDatabase("","HGmailntf.ntf") '邮件系统模板
fileName = Trim("mail\"+cgi.mailName(0)+".nsf")
Dim maildbtemp As notesdatabase
Set maildbtemp=session.getdatabase("",filename,False)

If maildbtemp.isopen=True Then
alertstr= "邮箱名为 "+cgi.mailname(0)+" 的邮箱已经存在了,不能注册"
Call printerr(alertstr)
Exit Sub
End If


众位高手,为什么我执行的时候老是出现 “Object variable not set 0”问题啊?
...全文
189 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
雷布斯尼亚 2005-02-02
  • 打赏
  • 举报
回复
两台服务器的配置一样吗,运行代理的用户在这两台服务器上的权限一样吗?
hulaishun 2005-02-02
  • 打赏
  • 举报
回复
这样你监控后台,就知道数据库的哪行代码出错
hulaishun 2005-02-02
  • 打赏
  • 举报
回复
sub 函数名
on error goto 函数名Error

***
函数功能代码

***
exit sub

'函数错误处理
函数名Error:
msgbox “In the 函数名,the No。”+cstr(erl)+space(2)+error$
exit sub

end sub
desertwolf81 2005-02-02
  • 打赏
  • 举报
回复

Set maildbtemp=session.getdatabase("",filename,False)

If maildbtemp.isopen=True Then
之间加入这个判断:
If maildbtemp Is Nothing Then
Msgbox "can't found mail db"
End if
看看。因为首先要判断NotesDatabase对象有没有创建,在用isopen去判断。
maplescloud 2005-02-01
  • 打赏
  • 举报
回复
你贴出来的代码是 sub 和 end sub 之间所有的吗,你最好用 on error goto 来打出你出错的行是哪一行,从上面大概分析似乎是maildbtemp这个变量没有内容,也就是说没有对应名称的邮件文件存在,请检查cgi.mailName(0)的有效性。
kgd198294 2005-02-01
  • 打赏
  • 举报
回复
补充一下,这段语句在R5上运行没问题,在R6上运行就出现“Object variable not set 0”,这是什么原因啊要?

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧