Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrieving session variables from vbscript sub

Status
Not open for further replies.

Fulvio

Programmer
Feb 18, 2001
1
IT
Ok here's the question:

i have a session variable called dbconn which connects to a sql server database.
i need to retrieve its value from a vbscript sub like this:

...somewhere in an asp page...
<script language=&quot;vbscript&quot;>
sub Retrieve_data
set connection=Session(&quot;dbconn&quot;)
set RecSet=CreateObject(&quot;ADODB.RecordSet&quot;)
querystr=&quot;Select * from tablename&quot;
RecSet.Open querystr, connection
.......
.......
end sub
</script>

this sub is linked with an onchange event of a listbox
user selects a value from the listbox and using the above sub i populate other fields....

the error is in the line:
set connection=Session(&quot;dbconn&quot;)

it's a type mismatch error but i don't think it's true i think instead the the sub doesn't recognize the session object...
i also think (but maybe i'm wrong) that the matter is something about client-side sub or something like that...

does anyone know how to solve this prob even in a different way (possibly without passing parameter as a submit from other forms)??? it's really important..... (sample code plz)

thanx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top