PDA

Click to See Complete Forum and Search --> : Preparing to Jump Out Window


idover
Jun 6th, 2001, 05:34 PM
sorry for the multiple post, but i just realized that more people view this forum than than the com/activex... thanks

This is driving me nuts... i have a component created that was working the last time that i used it... why won't this work!?!? * beats head against wall*... i have deleted a lot of code that would be useless on a forum...

asp returns:

Object variable or With block variable not set

and the problem is the sub Test... if i comment out the objResponse line, it runs fine...

I know that the component is instantiated, because it will execute an ado connection just fine, but when i try to use the asp intrinsic objects, it fails... any ideas?... thanks, in advance!


Private objApplication As Application
Private objRequest As Request
Private objResponse As Response
Private objServer As Server
Private objSession As Session

Public Sub OnStartPage(sc As Object)

Set objApplication = sc.Application
Set objRequest = sc.Request
Set objResponse = sc.Response
Set objServer = sc.Server
Set objSession = sc.Session

End Sub

Public Sub Test()

objResponse.Write "THIS IS A TEST"

End Sub

Public Sub OnEndPage()

Set objApplication = Nothing
Set objRequest = Nothing
Set objResponse = Nothing
Set objServer = Nothing
Set objSession = Nothing

End Sub

idover
Jun 6th, 2001, 05:36 PM
quick note: yes i made the proper reference to Active Server Pages Library... thanks...

Sundance Kid
Jun 7th, 2001, 07:53 AM
Try this

Private objApplication As NEW Application

Do it for all of your variables.

You need to instigate (sp) the variable, and not just refernce it.

Try it and tell me if it worked!

Good Luck

idover
Jun 7th, 2001, 08:16 AM
thanks!... but vb returns that it's an invalid use of the new keyword... any other ideas?...

JoshT
Jun 7th, 2001, 10:52 AM
What exactly is the sc Object being passed in the OnstartPage sub?

idover
Jun 7th, 2001, 11:02 AM
scripting context... i need it to use the intrinsic objects in asp: server, application, session, request, and response...

JoshT
Jun 7th, 2001, 01:06 PM
It would seem to me that the OnStartPage isn't being fired. Can you debug it to verify?

idover
Jun 7th, 2001, 05:04 PM
thanks... unfortunately, i'm just too damn busy to get back to it... at least not until next week... your help and input are appreciated... thanks!... i'll post again when i'm ready to pull my hair out...

idover
Jun 11th, 2001, 01:46 PM
for anyone else that encounters this problem...

i have for sometime now been using simply

CreateObject

instead of

Server.CreateObject

in the asp page...

i'm not sure exactly why i got into this habit... maybe to extend the life of the period key... make sure you use the latter... thanks for everyone's help