mcsd_me
08-05-2002, 11:56 AM
On an ASP page which would be the better use of creating the DLL?
Creating it and destroying it inside each function call(as below) or to create it at the TOP of the page and essentially SHARE it?
Thanks
:--------------------------------------------------------------------------------
'##################################################################### ##############################
#
function GetUsers(byval intChatid)
set Chat = server.CreateObject ("Chat.Utilities")
set GetUsers = Chat.RunSPReturnRS(CONNECTION_STRING, "db_GetUsers", _
Array(Array("id", adInteger, adParamInput, 4, intChatid)), Null)
set Chat = nothing
end function
'##################################################################### ##############################
#
function GetUserRole(byval intUserId, byval intChatRoomID)
set Chat = server.CreateObject ("Chat.Utilities")
set GetUserRole = Chat.RunSPReturnRS(CONNECTION_STRING, "db_GetUserRole", _
Array(Array("ChatRoomID", adInteger, adParamInput, 4, intChatRoomID), _
Array("UserID", adInteger, adParamInput, 4, intUserId)), Null)
set Chat = nothing
end function
'##################################################################### ##############################
#
function SetUserActivity(byval intUserId, byval intActivityStatus)
' intActivityStatus 1 = Active
' intActivityStatus 0 = InActive
set Chat = server.CreateObject ("Chat.Utilities")
Call Chat.RunSP(CONNECTION_STRING, "db_SetUserActivity", _
Array(Array("id", adInteger, adParamInput, 4, intUserId), _
Array("isActive", adInteger, adParamInput, 5, intActivityStatus)), Null)
set Chat = nothing
end function
Creating it and destroying it inside each function call(as below) or to create it at the TOP of the page and essentially SHARE it?
Thanks
:--------------------------------------------------------------------------------
'##################################################################### ##############################
#
function GetUsers(byval intChatid)
set Chat = server.CreateObject ("Chat.Utilities")
set GetUsers = Chat.RunSPReturnRS(CONNECTION_STRING, "db_GetUsers", _
Array(Array("id", adInteger, adParamInput, 4, intChatid)), Null)
set Chat = nothing
end function
'##################################################################### ##############################
#
function GetUserRole(byval intUserId, byval intChatRoomID)
set Chat = server.CreateObject ("Chat.Utilities")
set GetUserRole = Chat.RunSPReturnRS(CONNECTION_STRING, "db_GetUserRole", _
Array(Array("ChatRoomID", adInteger, adParamInput, 4, intChatRoomID), _
Array("UserID", adInteger, adParamInput, 4, intUserId)), Null)
set Chat = nothing
end function
'##################################################################### ##############################
#
function SetUserActivity(byval intUserId, byval intActivityStatus)
' intActivityStatus 1 = Active
' intActivityStatus 0 = InActive
set Chat = server.CreateObject ("Chat.Utilities")
Call Chat.RunSP(CONNECTION_STRING, "db_SetUserActivity", _
Array(Array("id", adInteger, adParamInput, 4, intUserId), _
Array("isActive", adInteger, adParamInput, 5, intActivityStatus)), Null)
set Chat = nothing
end function