function GetUserID(OnlineSn)
![](/Images/OutliningIndicators/None.gif)
OnlineSn = Replace(OnlineSn,"'","''")
Set sqlcmd = Server.CreateObject("ADODB.Command")
'Recordset、Command对象都可以通过ActiveConnection属性来连接Connection对象
sqlcmd.ActiveConnection = Conn
sqlcmd.CommandText = "Login_OnLine"
sqlcmd.CommandType = adCmdStoredProc
![](/Images/OutliningIndicators/None.gif)
set param1 = sqlcmd.CreateParameter("@OnlineSn",adVarChar,adParamInput,100,OnlineSn)
'param1 = Server.CreateObject("ADODB.Parameter")
'param1.type = adVarChar
'param1.Direction = adParamInput
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
sqlcmd.Parameters.Append(param1)
![](/Images/OutliningIndicators/None.gif)
set param2 = sqlcmd.CreateParameter("@LoginTime",adDBTime,adParamInput,,now)
sqlcmd.Parameters.Append(param2)
vau =" "
set param3 = sqlcmd.CreateParameter("@UserID",adVarChar,adParamOutput,100,vau)
sqlcmd.Parameters.Append(param3)
![](/Images/OutliningIndicators/None.gif)
sqlcmd.Execute
GetUserID = param3.value
![](/Images/OutliningIndicators/None.gif)
set sqlcmd = nothing
![](/Images/OutliningIndicators/None.gif)
end function 注意:要加上一个adovbs.inc常量对应文件