ActiveX control & passing a SQL string from asp\VBScript

hi

I've been working on a project were by i've created a graph program in VB (an activeX control; ocx) that is dynamically populated by data from an ASP page.

At present the asp page creates a text file in which it writes a SQL string that is then read by the activex control which in turn displays the values of that string on the line graph.

This all works, but i want the string passed by the asp page to the page that contains the activex control with out the use of the text file. (i.e. i need a way to pass the sql string directly into my activex control)

I've tried some solutions that other peole have given in this forum but most dont relate to my problem & non seem to work.

So i was woundering which is the best way to pass a variable string into my activeX control. ( a code example would be much appreciate )

Thanks

Palvinder Singh

p.s. i've done all the registering of the ocx file and displaying of the correct OBJECT ID and CLASS ID in web page
[1055 byte] By [palie] at [2007-11-18 17:38:33]
# 1 Re: ActiveX control & passing a SQL string from asp\VBScript
Pass it as a hidden field
Twodogs at 2007-11-9 23:18:59 >
# 2 Re: ActiveX control & passing a SQL string from asp\VBScript
I've used a hiddenfield to pass the sql string from my asp page to the page that contains the activx graph:

<%

Dim savedSQL
savedSQL = Request.Form("hiddenField")

%>

<OBJECT ID="activeXCGraph" CLASSID="CLSID:3ac4c6d2-e43e-48c5-af6c-4479cf929799"
CODEBASE="activeXGProject.ocx">
</OBJECT>

But the problem i have is that i need a way to pass 'savedSQL' string into my activeX control were it can be used to make the graph.

Palvinder Singh
palie at 2007-11-9 23:20:05 >
# 3 Re: ActiveX control & passing a SQL string from asp\VBScript
I really need to know if i can do this and because of the lack of replies i was woundering if its possible to do at all?

Palvinder singh
palie at 2007-11-9 23:21:11 >
# 4 Re: ActiveX control & passing a SQL string from asp\VBScript
What is the matter with having a public property in your Ocx to get the string value? Or you meant you need it in initialize method?
...
Like Moicrosoft shows you here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaxctrl/html/msdn_nctmr.asp

Defining the Timer Object in HTML
To use the Timer object, we need to include it on the Web page using the HTML <OBJECT> tag:

<OBJECT
ID="tmrMain"
CLASSID="CLSID:59CCB4A0-727D-11CF-AC36-00AA00A47DD2"
CODEBASE="http://www.myown.com/ax.cab">
<PARAM NAME="Interval" VALUE="5000">
</OBJECT>

where you could have:
savedSQL=your sqlstring
TheneededSql= the name off the property in your Ocx
<PARAM NAME="TheneededSql" VALUE="<%=savedSQL%>">
(probably you will have to encode the string you're passing...)
Cimperiali at 2007-11-9 23:22:06 >
# 5 Re: ActiveX control & passing a SQL string from asp\VBScript
Thanks Cimperiali for your reply and the link you supplied is exactly what i was looking for. I'm new to activeX controls and now have the ability to pass it variables, the possibilities are endless :)

Thank you

Palvinder Singh
palie at 2007-11-9 23:23:10 >