<% 'The PostingTypeIdIsValid function takes the posting type id and returns true if there exists a posting type with such an id (or false if not). Function PostingTypeIdIsValid(intPostingTypeId) On Error Resume Next dim cmd set cmd = Server.CreateObject("ADODB.Command") set cmd.ActiveConnection = conn cmd.CommandText = "SP_CONFIRM_POSTING_TYPE_EXISTS" cmd.CommandType = adCmdStoredProc cmd.Parameters.Append cmd.CreateParameter("POSTING_TYPE_ID", adInteger, adParamInput, , intPostingTypeId) cmd.Parameters.Append cmd.CreateParameter("POSTING_TYPE_EXISTS", adInteger, adParamOutput) cmd.execute 'if an error has occured report it If err.number <> 0 Then Call ReportError("PostingTypeIdIsValid", err.number, err.description) End If 'return the state of existence (true/false) of the submitted posting type id PostingTypeIdIsValid = CBool(cmd.Parameters("POSTING_TYPE_EXISTS")) 'release cmd object from memory set cmd = nothing On Error Goto 0 End Function 'The ModifyPosting procedure takes the posting id, posting type id, the opens in new window value, the posting date, title and body and modifies the related posting record in the DB. Sub ModifyPosting(intPostingId, intContentTypeId, intOpenInNewWindow, datPostingDate, strPostingTitle, strPostingBody) On Error Resume Next dim cmd set cmd = Server.CreateObject("ADODB.Command") set cmd.ActiveConnection = conn cmd.CommandText = "SP_SET_POSTING" cmd.CommandType = adCmdStoredProc cmd.Parameters.Append cmd.CreateParameter("POSTING_ID", adInteger, adParamInput, , intPostingId) cmd.Parameters.Append cmd.CreateParameter("DYNAMIC_CONTENT_TYPE_ID", adInteger, adParamInput, , intContentTypeId) cmd.Parameters.Append cmd.CreateParameter("POSTING_OPENS_IN_NEW_WINDOW", adBoolean, adParamInput, , intOpenInNewWindow) cmd.Parameters.Append cmd.CreateParameter("POSTING_DATE", adDBTimeStamp, adParamInput, , datPostingDate) cmd.Parameters.Append cmd.CreateParameter("POSTING_TITLE", adVarchar, adParamInput, 500, strPostingTitle) cmd.Parameters.Append cmd.CreateParameter("POSTING_BODY", adLongVarChar, adParamInput, Len(strPostingBody), strPostingBody) cmd.execute 'if an error has occured report it If err.number <> 0 Then Call ReportError("ModifyPosting", err.number, err.description) End If 'release cmd object from memory set cmd = nothing On Error Goto 0 End Sub 'The AddPosting function takes the posting type id, the opens in new window value, the posting date, title and body, inserts a new posting record in the DB and returns the new posting's id. Function AddPosting(intPostingTypeId, intContentTypeId, intOpenInNewWindow, datPostingDate, strPostingTitle, strPostingBody) On Error Resume Next dim cmd set cmd = Server.CreateObject("ADODB.Command") set cmd.ActiveConnection = conn cmd.CommandText = "SP_INSERT_POSTING" cmd.CommandType = adCmdStoredProc cmd.Parameters.Append cmd.CreateParameter("POSTING_ID", adInteger, adParamOutput) cmd.Parameters.Append cmd.CreateParameter("POSTING_TITLE", adVarchar, adParamInput, 500, strPostingTitle) cmd.Parameters.Append cmd.CreateParameter("POSTING_DATE", adDBTimeStamp, adParamInput, , datPostingDate) cmd.Parameters.Append cmd.CreateParameter("POSTING_TYPE_ID", adInteger, adParamInput, , intPostingTypeId) cmd.Parameters.Append cmd.CreateParameter("DYNAMIC_CONTENT_TYPE_ID", adInteger, adParamInput, , intContentTypeId) cmd.Parameters.Append cmd.CreateParameter("POSTING_OPENS_IN_NEW_WINDOW", adBoolean, adParamInput, , intOpenInNewWindow) cmd.Parameters.Append cmd.CreateParameter("POSTING_BODY", adLongVarChar, adParamInput, Len(strPostingBody), strPostingBody) cmd.execute AddPosting = cmd.Parameters("POSTING_ID") 'if an error has occured report it If err.number <> 0 Then Call ReportError("AddPosting", err.number, err.description) End If 'release cmd object from memory set cmd = nothing On Error Goto 0 End Function 'The DeletePosting procedure takes a posting id and deletes the related posting record from the DB. Sub DeletePosting(intPostingId) On Error Resume Next dim cmd set cmd = Server.CreateObject("ADODB.Command") set cmd.ActiveConnection = conn cmd.CommandText = "SP_DELETE_POSTING" cmd.CommandType = adCmdStoredProc cmd.Parameters.Append cmd.CreateParameter("POSTING_ID", adInteger, adParamInput, , intPostingId) cmd.execute 'if an error has occured report it If err.number <> 0 Then Call ReportError("DeletePosting", err.number, err.description) End If 'release cmd object from memory set cmd = nothing On Error Goto 0 End Sub %>