IIS ASP - how to solve this?

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > June 2004 > how to solve this?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author how to solve this?
Andre

2004-06-26, 10:19 am

Hi,

In 'test.htm', there are two Select, one visible, the other invisible. The
second becomes visible only if the number of records in a Access table <2.
There is also a button to start the VB-procedure. I choose first a value
into the first Select (sel1), then i click on the button to start
VB-procedure. If the value="a", then get the number of records in a table of
Access. So i made a INPUT within a form and go to test2.asp which gets the
number of records ('tot') i need.

My problem is now: how to get back to 'test.htm' with the number of records
('tot') in order to test that number and to make or not the second Select
visible?
I can do this using RDS, because then everything can be put in VB, but i
want to solve this without RDS.
Thanks for any help.
andré

file 'test.htm':
<SELECT name=sel >
<option value="a" > a
<option value="b" > b
</SELECT>
<SELECT name=sel2 style="visibility:hidden">
<option value="c" > c
<option value="d" > d
</SELECT>

<INPUT name=reg TYPE="button" value="test">

<form name=ins>
<input name="rpc" type="hidden" value="" >
</form>

<script language=vbscript>
sub reg_onclick()
value=sel.value
if value="a" then
document.getElementById("rpc").value=a
ins.action="test2.asp"
ins.method="post"
ins.submit
end if

if 'tot' obtained in test2.asp >=2 then
msgbox ("you have already 2 items .. whatever .....")
else
sel2.style.visibility="visible"
.....
end if
end sub
</script>

file 'test2.asp':
<%
set objdc = Server.CreateObject("ADODB.Connection")
objdc.Open("provider=Microsoft.Jet.OLEDB.4.0; Data Source
=d:\access\newres.mdb")
sql="select items from mytable;"
set rs=Server.CreateObject("ADODB.recordset")
rs.open sql, objdc, 3, 3
tot=rs.recordcount
%>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com