how to solve this?

Discussion in 'ASP General' started by Andre, Jun 26, 2004.

  1. Andre

    Andre Guest

    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
    %>
     
    Andre, Jun 26, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tony

    how to solve file.copy problem

    tony, Aug 23, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    3,848
    Raghavendra T V
    Aug 26, 2004
  2. Ajith Nair

    How to solve COMException

    Ajith Nair, Jul 19, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,876
    Wencheng Magiya
    Jul 22, 2005
  3. Ajith Nair
    Replies:
    0
    Views:
    1,650
    Ajith Nair
    Aug 17, 2005
  4. Replies:
    1
    Views:
    2,859
    Kevin Spencer
    Sep 30, 2005
  5. Chao
    Replies:
    6
    Views:
    1,309
    Mike Treseler
    Jul 5, 2004
Loading...

Share This Page