写好在vb里正常,用顺利编译,但是asp中调用不了.运行死了.无任何结果.
以下是vb代码:
Private Context As ScriptingContext
Private Application As Application
Private Response As Response
Private Request As Request
Private Session As Session
Private Server As ServerPublic Sub OnStartPage(PassedscriptContext As ScriptingContext)
Set Context = PassedscriptContext
Set Application = Context.Application
Set Request = Context.Request
Set Response = Context.Response
Set Server = Context.Server
Set Session = Context.Session
End SubPrivate Sub Class_Terminate()
Rs.Close
Set Rs = Nothing
conn.Close
Set conn = Nothing
End Sub'查找该域名下的第一个用户号码(JiUid)
Public Function JiGetJiUid(CUid)
Set Rs = Server.CreateObject("adodb.recordset")
Rs.Open "select JiUid,homepage from JiUser where cuID= " & CUid & " AND JiType ='admin'", conn, 1, 1
If Not Rs.EOF Then
JiUID = Rs("JiUid")
Else
JiUID = 0
End If
Rs.Close
JiGetJiUid = JiUID
End Function
Public Sub OnEndPage()
Set Application = Nothing
Set Request = Nothing
Set Response = Nothing
Set Server = Nothing
Set Session = Nothing
Set Context = Nothing
End Subasp代码:
<%
SqlLocalName ="(local)" '连接IP [ 本地用 (local) 外地用IP ]
SqlUsername ="sa" '用户名
SqlPassword ="" '用户密码
set conn=server.createobject("adodb.connection")
SqlDatabaseName="ji_pro" '数据库名
conn.Open "Provider=Sqloledb; User ID=" & SqlUsername & "; Password=" & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source=" & SqlLocalName & ";"Dim JiUser
Set JiUser=Server.CreateObject("JiUser.JiZone")
a=JiUser.JiGetJiUid("64")
response.write a
%>
请各高人能看看是什么问题吗?
以下是vb代码:
Private Context As ScriptingContext
Private Application As Application
Private Response As Response
Private Request As Request
Private Session As Session
Private Server As ServerPublic Sub OnStartPage(PassedscriptContext As ScriptingContext)
Set Context = PassedscriptContext
Set Application = Context.Application
Set Request = Context.Request
Set Response = Context.Response
Set Server = Context.Server
Set Session = Context.Session
End SubPrivate Sub Class_Terminate()
Rs.Close
Set Rs = Nothing
conn.Close
Set conn = Nothing
End Sub'查找该域名下的第一个用户号码(JiUid)
Public Function JiGetJiUid(CUid)
Set Rs = Server.CreateObject("adodb.recordset")
Rs.Open "select JiUid,homepage from JiUser where cuID= " & CUid & " AND JiType ='admin'", conn, 1, 1
If Not Rs.EOF Then
JiUID = Rs("JiUid")
Else
JiUID = 0
End If
Rs.Close
JiGetJiUid = JiUID
End Function
Public Sub OnEndPage()
Set Application = Nothing
Set Request = Nothing
Set Response = Nothing
Set Server = Nothing
Set Session = Nothing
Set Context = Nothing
End Subasp代码:
<%
SqlLocalName ="(local)" '连接IP [ 本地用 (local) 外地用IP ]
SqlUsername ="sa" '用户名
SqlPassword ="" '用户密码
set conn=server.createobject("adodb.connection")
SqlDatabaseName="ji_pro" '数据库名
conn.Open "Provider=Sqloledb; User ID=" & SqlUsername & "; Password=" & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source=" & SqlLocalName & ";"Dim JiUser
Set JiUser=Server.CreateObject("JiUser.JiZone")
a=JiUser.JiGetJiUid("64")
response.write a
%>
请各高人能看看是什么问题吗?
RECORDSET和CONNECTION定义了吗?
还有,你在CLASS中所有变量都是变体吗?
JiGetJiUid没有指明类型。