Results 1 to 7 of 7

Thread: response object

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    43

    response object

    In my asp page I call a component that processes a query. When the query is finished I want to return the results to the asp page. I want to use Response.Write inside my component but I keep getting an error:
    "Object variable or With block variable not set"

    can someone please help!

  2. #2
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    could you give an example of the code you are trying to use ?

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    43
    Private m_Response As Response

    Public Sub OnStartPage(objScriptingContext As ScriptingContext)
    Set m_Response = objScriptingContext.Response
    End Sub

    Public Sub WebOutput(strMessage As String, Optional boxMsg)
    m_Response.Write strMessage
    End Sub

    Public Sub OnEndPage()
    Set m_Response = Nothing
    End Sub

  4. #4
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609

    Smile

    wow, ok, i dont know any of that stuff. sorry. thought i could help.

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    43
    Thanks anyways. If anybody can help i'd appreciate it.

  6. #6
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    hi

    you will need a page object to write to the page from the component.

  7. #7
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    reference MS ASP Object Library:

    VB Code:
    1. Option Explicit
    2.  
    3. Private MyScriptingContext As ScriptingContext
    4. Private MyApplication As Application
    5. Private MyRequest As Request
    6. Private MyResponse As Response
    7. Private MyServer As Server
    8. Private MySession As Session
    9.  
    10. Public Sub OnStartPage(PassedScriptingContext As ScriptingContext)
    11.     'get references to the ASP built in objects
    12.     Set MyScriptingContext = PassedScriptingContext
    13.     Set MyApplication = MyScriptingContext.Application
    14.     Set MyRequest = MyScriptingContext.Request
    15.     Set MyResponse = MyScriptingContext.Response
    16.     Set MyServer = MyScriptingContext.Server
    17.     Set MySession = MyScriptingContext.Session
    18. End Sub
    19.  
    20. Public Sub OnEndPage()
    21.     'release the references
    22.     Set MyScriptingContext = Nothing
    23.     Set MyApplication = Nothing
    24.     Set MyRequest = Nothing
    25.     Set MyResponse = Nothing
    26.     Set MyServer = Nothing
    27.     Set MySession = Nothing
    28. End Sub
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width