我需要有人向我解释这个 ASP 功能
我有一个 5 年前的 ASP 文档。实际上我正在使用 PHP,但我必须将 ASP 用于 Windows 应用程序。所以我需要有人向我解释这个功能。
//DNS 设置已包含在内。
function Check_Is_Web_Locked()
dim cmdDB , Ret
OpenDatabase
Set cmdDB = Server.CreateObject("ADODB.Command")
With cmdDB
.ActiveConnection = DBCon
.CommandText = "TICT_CHECK_WEB_STATUS"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("RETURN_VALUE", adInteger, adParamReturnValue, 0)
.Execute,,adExecuteNoRecords
Ret = Trim(.Parameters("RETURN_VALUE"))
End With
Set cmdDB = Nothing
CloseDatabase
Check_Is_Web_Locked = Ret
end function
这个函数有什么作用?
“TICT_CHECK_WEB_STATUS”是存储过程吗?
如果是的话,函数寻找的列是什么?
I've got an ASP document that 5 years old. Actually I'm working with PHP but I must use ASP for a Windows Application. So I need someone to explain this function to me.
//DNS SETTINGS ARE INCLUDED ALREADY.
function Check_Is_Web_Locked()
dim cmdDB , Ret
OpenDatabase
Set cmdDB = Server.CreateObject("ADODB.Command")
With cmdDB
.ActiveConnection = DBCon
.CommandText = "TICT_CHECK_WEB_STATUS"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("RETURN_VALUE", adInteger, adParamReturnValue, 0)
.Execute,,adExecuteNoRecords
Ret = Trim(.Parameters("RETURN_VALUE"))
End With
Set cmdDB = Nothing
CloseDatabase
Check_Is_Web_Locked = Ret
end function
What does this function do?
Is "TICT_CHECK_WEB_STATUS" a stored procedure?
If it's what are the columns that function looking for?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,
TICT_CHECK_WEB_STATUS
是数据库中的存储过程。此 SP 返回一个名为RETURN_VALUE
的“有符号整数”输出参数,当从 SP 返回时,其值将存储在Ret
变量中。Trim
函数应该从RETURN_VALUE
中去除任何空格,但由于它是一个整数,因此永远不会去除任何空格。因此它只是将返回值转换为字符串。最后,该函数返回
Ret
字符串。这是通过Check_Is_Web_Locked = Ret
语句完成的。Yes,
TICT_CHECK_WEB_STATUS
is a stored procedure in the database. This SP returns a "signed integer" output parameter calledRETURN_VALUE
, whose value gets stored in theRet
variable when it is returned from the SP.The
Trim
function should strip out any white-space fromRETURN_VALUE
, but since it is an integer there will never by any. Therefore it is simply converting the return value into a string.Finally the function is returning the
Ret
string. This is done with theCheck_Is_Web_Locked = Ret
statement.这看起来就像是对数据库的某种心跳(即网页通过调用
TICT_CHECK_WEB_STATUS
说“嘿,数据库,你还活着吗?”)。是的,TICT_CHECK_WEB_STATUS
是一个存储过程。This looks like it's just a heartbeat of sorts to the database (i.e. the web page is saying "Hey Database, are you alive?" by calling
TICT_CHECK_WEB_STATUS
). And yes,TICT_CHECK_WEB_STATUS
is a stored proc.TICT_CHECK_WEB_STATUS 显然是一个存储过程,它返回一个名为 Return_Value 的输出参数值。该值存储在名为 Ret 的变量中。
TICT_CHECK_WEB_STATUS is apparently a stored proc that returns an output parameter value called Return_Value. That value is stored in a variable called Ret.