VB--- error using GetObjectContext.Item("Request") 
Author Message
 VB--- error using GetObjectContext.Item("Request")

Hi-
I wonder if anyone can help.
I'm having problems with the following bit of code. Basically when it hits
line 3 it bombs out with an "object required" error. The annoying thing is
that I have got this to work on another PC. The ASP page which fires this
off is run on a local IIS (Windows 2000)- and the ASP page resides in its a
virtual directory.

Is there anyone who may have an inkling as to why I can't reference the
Request option??

   1   Dim oRequest As ASPTypeLibrary.Request
   2   Dim oServer As ASPTypeLibrary.Server

   3   Set oRequest = GetObjectContext.Item("Request")
   4   Set oServer = GetObjectContext.Item("Server")

thanks

Paul.



Sun, 18 Apr 2004 20:20:12 GMT  
 VB--- error using GetObjectContext.Item("Request")

Quote:
>Is there anyone who may have an inkling as to why I can't reference the
>Request option??

>   1   Dim oRequest As ASPTypeLibrary.Request
>   2   Dim oServer As ASPTypeLibrary.Server

>   3   Set oRequest = GetObjectContext.Item("Request")
>   4   Set oServer = GetObjectContext.Item("Server")

I've never saw it being done like this.
Personally I always use the following code:

Private MyScriptingContext As ASPTypeLibrary.ScriptingContext
Private MyResponse As ASPTypeLibrary.Response
Private MyRequest As ASPTypeLibrary.Request
Private MyServer As ASPTypeLibrary.Server

' Called from IIS, set up our own references to internal ASP
components
'-----------------------------------------------------------------------
Public Sub OnStartPage(PassedScriptingContext As ScriptingContext)
    Set MyScriptingContext = PassedScriptingContext
    Set MyResponse = MyScriptingContext.Response
    Set MyRequest = MyScriptingContext.Request
    Set MyServer = MyScriptingContext.Server
End Sub

' Called from IIS, destroy our own references to internal ASP
components
'------------------------------------------------------------------------
Public Sub OnEndPage()
    Set MyServer = Nothing
    Set MyRequest = Nothing
    Set MyResponse = Nothing
    Set MyScriptingContext = Nothing
End Sub

Grtz,
Marco



Mon, 19 Apr 2004 07:00:01 GMT  
 VB--- error using GetObjectContext.Item("Request")
also
you could do this.. but you need to use MTS or COM+
services I think here is the link

http://support.microsoft.com/directory/article.asp?
ID=KB;EN-US;Q238274

Quote:
>-----Original Message-----
>>Is there anyone who may have an inkling as to why I
can't reference the
>>Request option??

>>   1   Dim oRequest As ASPTypeLibrary.Request
>>   2   Dim oServer As ASPTypeLibrary.Server

>>   3   Set oRequest = GetObjectContext.Item("Request")
>>   4   Set oServer = GetObjectContext.Item("Server")

>I've never saw it being done like this.
>Personally I always use the following code:

>Private MyScriptingContext As

ASPTypeLibrary.ScriptingContext

- Show quoted text -

Quote:
>Private MyResponse As ASPTypeLibrary.Response
>Private MyRequest As ASPTypeLibrary.Request
>Private MyServer As ASPTypeLibrary.Server

>' Called from IIS, set up our own references to internal
ASP
>components
>'---------------------------------------------------------
--------------
>Public Sub OnStartPage(PassedScriptingContext As
ScriptingContext)
>    Set MyScriptingContext = PassedScriptingContext
>    Set MyResponse = MyScriptingContext.Response
>    Set MyRequest = MyScriptingContext.Request
>    Set MyServer = MyScriptingContext.Server
>End Sub

>' Called from IIS, destroy our own references to internal
ASP
>components
>'---------------------------------------------------------
---------------
>Public Sub OnEndPage()
>    Set MyServer = Nothing
>    Set MyRequest = Nothing
>    Set MyResponse = Nothing
>    Set MyScriptingContext = Nothing
>End Sub

>Grtz,
>Marco
>.



Sun, 06 Jun 2004 08:44:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB6--- error using GetObjectContext.Item("Request")

2. VB6-- problem with GetObjectContext.Item("Request")

3. Getting objects from GetObjectContext.Item("MyOwnObject")

4. Error from GetObjectContext.CreateInstance("...")

5. getobjectcontext("response")

6. "InputBox" using for password request

7. "Component request pending" error

8. Using "Item.Send"

9. Using collection.Item("key")

10. "Unknown error" using GetFolderFromID method

11. "Unknown error" using GetFolderFromID method

12. "Not Liscensed" error using Sheridan 3dcontrols

 

 
Powered by phpBB® Forum Software