'先引用了active server pages objectDim rq As RequestPublic Sub OnStartPage(MyScriptingContext As ScriptingContext)
Set rq = MyScriptingContext.Request
End SubPublic Sub OnEndPage()
Set rp = Nothing
End SubPublic Function helloword() As Variant
helloword = rq.QueryString("dddd")
End Function'************************
s.asp文件如下:
<%
set aa=createobject("example.myclass")
response.write aa.helloword()
%>但是为什么会报如下错误呢?
错误类型:
example (0x800A005B)
未设置对象变量或 With block 变量
/s.asp, 第 3 行
Set rq = MyScriptingContext.Request
End SubPublic Sub OnEndPage()
Set rp = Nothing
End SubPublic Function helloword() As Variant
helloword = rq.QueryString("dddd")
End Function'************************
s.asp文件如下:
<%
set aa=createobject("example.myclass")
response.write aa.helloword()
%>但是为什么会报如下错误呢?
错误类型:
example (0x800A005B)
未设置对象变量或 With block 变量
/s.asp, 第 3 行
'这里写错了
Set rq = Nothing
End Sub还有你的asp页面这样访问http://xxx.com/s.asp?dddd=hello
参考
http://blog.csdn.net/online/archive/2004/08/19/78624.aspx
<%
set aa=createobject("example.myclass")
%>
最好写成server.createobject如果写成了createobject多了会死机的,这个在ASP版早有讨论老龙眼睛真尖啊