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?
Yes, TICT_CHECK_WEB_STATUS
is a stored procedure in the database. This SP returns a "signed integer" output parameter called RETURN_VALUE
, whose value gets stored in the Ret
variable when it is returned from the SP.
The Trim
function should strip out any white-space from RETURN_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 the Check_Is_Web_Locked = Ret
statement.