Click to See Complete Forum and Search --> : Passing variables/parameters from ASP to ActiveX
EBowman
August 6th, 2001, 05:19 PM
I need to retrieve a QueryString/Form variable posted via an ASP page to an ActiveX control so that I can then run a query against a database on the Web server via the ActiveX control.
Can you show me how to retrieve the posted variable within the ActiveX Control(VB)?
coolbiz
August 6th, 2001, 05:53 PM
Just a suggestion. You can provide a method in your ActiveX control so that you can pass the information via ASP. So if you have a method call RunQuery(), you can do the following:
<%
oQuery = Server.CreateObject("YourActiveX")
oQuery.RunQuery <the value that is passed from ASP page>
%>
-Cool Bizs
EBowman
August 6th, 2001, 06:01 PM
Okay. I think I understand what you are suggesting -- however, maybe my question is even more rudimentary than it appears.
How do I "read" the variable that I am passing via a QueryString by the ActiveX Control (OCX) that is resident on the resulting ASP page?
So if I have an ASP data entry form and I post this to another ASP page that has the OCX referenced on it(object classid), How do I pass the variable from the ASP to the OCX?
coolbiz
August 7th, 2001, 12:34 AM
I might be wrong but I think you won't be able to do that. When you instantiate the ActiveX control, it does not work by itself does it? It has to somehow receive some kind of signal from someone in order to work.
However, if you're actually developing an ISAPI extension (I've never done this but have seen a colleague working on it), you should be able to retrieve the QueryString data directly. Of course this does not interface via ASP.
I might be totally misunderstood you .. but this is a little help that I could offer :)
-Cool Bizs
Spectre
August 8th, 2001, 06:25 AM
If your dll is running under MTS, you can get a reference to the MTS object context. This allows your dll to directly access the intrinsic ASP objects (Server, Request, Response, etc.) directly from within the dll. Then it is just a matter of doing a Request.QueryString("YourVariableName") to get your parameter value.
Hope this helps.
Spectre
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.