p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Request object error 'ASP 0102 : 80004005'


Message #1 by Gregory_Griffiths@c... on Mon, 12 Mar 2001 16:03:51 +0000
call ValidateUser()

> -----Original Message-----
> From: rchartierh@a... [mailto:rchartierh@a...]
> Sent: 12 March 2001 16:45
> To: proasp_codeclinic@p...
> Subject: RE: Request object error 'ASP 0102 : 80004005'
> 
> 
> how are you calling it?
> 
> ValidateUser
> call ValidateUser()
> ?
> 
> 
> 
> 
> At 11:33 AM 3/12/01, you wrote:
> >doesn't fix it
> >
> >
> > > -----Original Message-----
> > > From: rchartierh@a... [mailto:rchartierh@a...]
> > > Sent: 12 March 2001 16:13
> > > To: proasp_codeclinic@p...; rchartierh@a...
> > > Subject: Re: Request object error 'ASP 0102 : 80004005'
> > >
> > >
> > >
> > > try changing:
> > >
> > > sub ValidateUser
> > >
> > >
> > > to
> > >
> > > sub ValidateUser()
> > >
> > > ?
> > >
> > >
> > > At 11:03 AM 3/12/01, you wrote:
> > > >Dear All,
> > > >         I am getting the following error :
> > > >
> > > >Request object error 'ASP 0102 : 80004005'
> > > >
> > > >Expecting string input
> > > >
> > > >/scripts/npd/wfmanager.asp, line 43
> > > >
> > > >The function expects a string as input.
> > > >
> > > >Line 43 is the line
> > > >
> > > >sub ValidateUser()
> > > >
> > > >and when the sub is removed the error doesn't change, I
> > > think it could
> > > >be something to do with using the Query String as the 
> inital call and
> > > >then the Forms after that and the checking for which one I'm
> > > using, but
> > > >I thought I had got that sorted, any ideas ?
> > > >
> > > ><%
> > > >'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> > > '''''''''''
> > > >''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> > > >' Program Name : WFManagment Tool
> > > >' Author : Greg Griffiths
> > > >' Purpose : To provide additional functionality to that 
> provided in
> > > >OpenText's Livelink products Workflow module.
> > > >' Created : 12 March 2001
> > > >' Change History :
> > > >'                       1.0 Inital Concept Draft (12 March 2001)
> > > >' Usage :
> > > >'               Inital call to the ASP must be in the format
> > > >wfmanager.asp?WF=X where X is an integer value.
> > > >'               This integer value should then be added 
> to both the
> > > >WhichWFList and ValidateUser subs and amend them as appropriate.
> > > >'               Subsequent interaction will use a hidden
> > > field to convey
> > > >values to and from the app, although a cookie could be used
> > > >'               just as easily.
> > > >'               To add a user to the system, simply add 
> them to the
> > > >ValidateUser sub in the correct place.
> > > >'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> > > '''''''''''
> > > >''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> > > >
> > > >' Global Variables
> > > >Dim SQLString   ' This stores the SQL that we will execute.
> > > >Dim WFType              ' Value of the Query String - only
> > > used in first
> > > >call
> > > >Dim ValidUser   ' Valid User
> > > >Dim WorkType    ' Action requested by user
> > > >Dim ServerPath  ' URL to server including trailing slash
> > > >Dim Status              ' Status flag indicating which point
> > > the user is at
> > > >in the application.
> > > >
> > > >' initialise values
> > > >SQLString=""
> > > >WFType=0
> > > >ValidUser=0
> > > >WorkType=0
> > > >ServerPath="http://svf.ttscripts.eu.cargill.com/scripts/npd/"
> > > >
> > > >''''''''''''''''''''''''''''''''''
> > > >' Securtity Routines
> > > >''''''''''''''''''''''''''''''''''
> > > >
> > > >' this sub sends back an invalid user message
> > > >sub InvalidUser()
> > > >         response.write("Hello World")
> > > >end sub
> > > >
> > > >' This sub validates the user for the action they are wishing to
> > > >perform.
> > > >' This sub currently uses the Cookie that is created as 
> a seperate
> > > >customisation to validate the user, should consider 
> using the LL API.
> > > >sub ValidateUser
> > > >
> > > >         ' reset the ValidUser Boolean
> > > >         ValidUser=0
> > > >
> > > >         ' declare a local var
> > > >         Dim CurrentUser
> > > >
> > > >         ' initalise the CurrentUser value with the value of
> > > the cookie
> > > >         CurrentUser=Request.Cookies("teamtalkusername")
> > > >
> > > >                 ' validate the user according to the WF Type
> > > >                 Select Case WFType
> > > >
> > > >                         ' If this is a Credit Claims lookup
> > > >                         Case 1
> > > >                                         ' is the value of
> > > the cookie (the
> > > > username)
> > > >equal to any of the following
> > > >                                         if
> > > ((CurrentUser="ggriffit") OR
> > > >(CurrentUser="lconnors")) then
> > > >                                                 ValidUser=1
> > > >                                         end if
> > > >                 End Select
> > > >end sub
> > > >
> > > >''''''''''''''''''''''''''''''''''
> > > >' DB Lookup routines
> > > >''''''''''''''''''''''''''''''''''
> > > >
> > > >' This function takes the parameter passed on the query 
> string when
> > > >first called and then chooses the appropriate lookup
> > > >sub WhichWFList()
> > > >
> > > >         ' select the correct SQL
> > > >         Select Case WFType
> > > >
> > > >                 ' If this is a Credit Claims lookup
> > > >                 Case 1
> > > >                                 ' Select all workflow
> > > titles that are
> > > > active and
> > > >have a title that starts CC in either case
> > > >                                 SQLString="SELECT
> > > work_title FROM wwork
> > > > WHERE
> > > >work_status=2 AND upper(work_title) like upper('CC%')"
> > > >                 End Select
> > > >end sub
> > > >
> > > >''''''''''''''''''''''''''''''''''
> > > >' Display Routines
> > > >''''''''''''''''''''''''''''''''''
> > > >
> > > >' display the Header
> > > >sub DisplayHeader()
> > > >         Response.Write("<html>")
> > > >         Response.Write("<body>")
> > > >         Response.Write("<table width='100%' border='0'
> > > cellpadding='0'
> > > >cellspacing='0'>")
> > > >         Response.Write("<tr>")
> > > >         Response.Write("<td width='20%' 
> align='center'> </td>")
> > > >         Response.Write("<td width='60%'
> > > align='center'><font face='comic
> > > >sans ms,arial' size='+2'>Workflow Managment Tool</font></td>")
> > > >         Response.Write("<td width='20%' 
> align='center'> </td>")
> > > >         Response.Write("</table>")
> > > >         Response.Write("<p>")
> > > >end sub
> > > >
> > > >' this sub closes the page
> > > >sub DisplayFooter()
> > > >         Response.Write("</body>")
> > > >         Response.Write("</html>")
> > > >end sub
> > > >
> > > >' this sub displays a provided error message to the user
> > > >sub DisplayError(errmsg)
> > > >         Response.Write("<html><body>")
> > > >         Response.Write(errmsg)
> > > >         Response.Write("</body></html>")
> > > >end sub
> > > >
> > > >' provide the list that the user can select from
> > > >sub DisplayWorkflowTitles()
> > > >
> > > >         ' declare local variables
> > > >         Dim WFNames
> > > >
> > > >         ' initalise local variables
> > > >         WFNames="<option selected>Please Select A
> > > Workflow</option> "
> > > >
> > > >         ' Send Header
> > > >         DisplayHeader
> > > >
> > > >         ' create a DB Connection
> > > >         set dbConn = server.createobject("ADODB.connection")
> > > >         dbConn.open "TTLive", "livelink", "linklive"
> > > >
> > > >         ' execute the SQLString
> > > >         set results=dbConn.execute(SQLString)
> > > >
> > > >         Do While Not results.EOF
> > > >
> > > >                 WFNames=WFNames & "<option>" &
> > > results("work_title") &
> > > >"</option>"
> > > >
> > > >                 results.movenext
> > > >         loop
> > > >
> > > >         ' close the results set
> > > >         results.close
> > > >
> > > >         ' close the database connection
> > > >         dbConn.close
> > > >
> > > >         ' send back the content section
> > > >         Response.Write("<font size='+2'>P</font>lease
> > > select a workflow
> > > >from the following list<p>")
> > > >         Response.Write("<form name='wflist' method='post'
> > > action='" &
> > > >ServerPath & "wfmanager.asp'")
> > > >         Response.Write("<center><select name='wfname'>" 
> & WFNames &
> > > >"</select></center>")
> > > >         Response.Write("<input TYPE='hidden'
> > > NAME='actiontype' value='" &
> > > >WorkType & "'>")
> > > >         Response.Write("<input TYPE='hidden' NAME='wfgroup'
> > > value='" &
> > > >WFType & "'>")
> > > >         Response.Write("<input TYPE='hidden' NAME='status'
> > > value='1'>")
> > > >         Response.Write("<input TYPE='submit' VALUE='Retrieve'>")
> > > >         Response.Write("</form>")
> > > >
> > > >         ' send Footer
> > > >         DisplayFooter
> > > >end sub
> > > >
> > > >''''''''''''''''''''''''
> > > >' Main Program
> > > >''''''''''''''''''''''''
> > > >
> > > >if (Request.QueryString("TYPE")<>"") then
> > > >
> > > >         ' Get the action from the querystring
> > > >         WorkType=Request.QueryString("TYPE")
> > > >
> > > >         ' What is our Action
> > > >         Select Case WorkType
> > > >
> > > >                 ' Workflow Title Change
> > > >                 Case 1
> > > >                         ' get the WF type
> > > >                         WFType=Request.QueryString("WF")
> > > >
> > > >                         ' do we have a non-zero value, if
> > > we do then we are
> > > >calling this app for the first time
> > > >                         if (WFType>0) then
> > > >
> > > >                                 ' validate user
> > > >                                 call ValidateUser()
> > > >
> > > >                                 ' if the user is valid
> > > >                                 if (ValidUser=1) then
> > > >
> > > >                                         ' set the SQLString
> > > >                                         call WhichWFList
> > > >
> > > >                                         ' display the list
> > > to the client
> > > >                                         call 
> DisplayWorkflowTitles
> > > >                                 else
> > > >                                         ' invalid user
> > > >                                         call InvalidUser
> > > >                                 end if
> > > >                         else
> > > >                                 Response.Write("ZERO")
> > > >                         end if
> > > >
> > > >                 ' Otherwise we have an invalid action, so
> > > display an error
> > > >message
> > > >                 Case Else
> > > >                         call DisplayError("<center><font
> > > face='arial'
> > > >size='+2'><b>Action not available</b>.</font><p>Please 
> contact your
> > > >Helpdesk.</center>")
> > > >         End Select
> > > >
> > > >' Otherwise we have had a form submitted which means that we are
> > > >currently processing an event
> > > >else
> > > >         response.write("HERE")
> > > >
> > > >         ' get the field from the form, if it does not exist
> > > then WorkType
> > > >is still 0 and so will fail the next evaluation
> > > >         if (Request.Form("actiontype")<>"") then
> > > >
> > > >                 ' get it
> > > >                 WorkType=Request.Form("actiontype")
> > > >         end if
> > > >
> > > >         ' do we have a valid WorkType now ?
> > > >         if (WorkType>0) then
> > > >
> > > >                 ' What action are we doing ?
> > > >                 Select Case     WorkType
> > > >
> > > >                         ' WF Title Change
> > > >                         Case 1
> > > >                                 ' get the group and the
> > > status flags from
> > > > the form
> > > >                                 WFType=Request.Form("wfgroup")
> > > >                                 Status=Request.Form("status")
> > > >
> > > >                                 response.write("HERE with
> > > "&wfgroup&" AND
> > > > "&status)
> > > >
> > > >                         ' otherwise
> > > >                         Case Else
> > > >                                 call DisplayError("<center><font
> > > > face='arial'
> > > >size='+2'><b>Action not available</b>.</font><p>Please 
> contact your
> > > >Helpdesk.</center>")
> > > >                 End Select
> > > >         ' otherwise
> > > >         else
> > > >                 call DisplayError("<center><font face='arial'
> > > >size='+2'><b>Action not available</b>.</font><p>Please 
> contact your
> > > >Helpdesk.</center>")
> > > >         end if
> > > >end if
> > > >%>
> > > >
> 

  Return to Index