Page which Displays data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramdil
    New Member
    • Dec 2007
    • 46

    Page which Displays data

    Hi

    This is my new post in this group.I always find good support in Access group.So hoping to get the same from this group also.I have a table with three columns in access table.Now i want to create a webpage which will ask input the serial no .When they press button, it should show in a table the related records in the table .Can any one help me by giving the code for doing this.or any good related links so that i can do it.My final aim is that if more than one user is there, they browse the page thru url and find the results.

    Thanks in advance
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    You can try this code for your requirement . Your page1.asp will contian the following code and it will used for taking the serial no input.

    Code:
      
            <html>
            <head>
            </head>
            <body>
                 <form method="post" action = "Page2.asp">
                  <INPUT id="SerialNo"> 
                  <INPUT type="Submit" value="Submit">
                  </form>
             </body> 
             </html>
    Now , on page 2 write the following code for displaying the data.

    Code:
      
                <%
                     Dim serialNo
                     serialNo = Request.Form("SerialNo")
                
                     'Open the connection to the db
                     Dim con
                     set con = Server.CreateObject("Adodb.Connection")
                     con.ConnectionString= "....."
                     con.open
                   
                     'Make the recordset
                     Dim rs
                     set rs = Server.CreateObject("Adodb.Recordset")
                     
                     'Open recordset
    
                     Dim Sql  
                     Sql = "Select columnname1,columnname2,...... columnnameN
                      From tablename where Serialno = " & SerialNo &" 
                      rs = con.execute(Sql)
    
                     'Display results from recordset on the page
                     If not rs.Eof
                          Response.write(rs.Fields(0))
                         .............................
                     End if 
    
                    'Close the recordset
                    rs.close
     
                   'Close the connection
                   con.close
                 %>


    Originally posted by ramdil
    Hi

    This is my new post in this group.I always find good support in Access group.So hoping to get the same from this group also.I have a table with three columns in access table.Now i want to create a webpage which will ask input the serial no .When they press button, it should show in a table the related records in the table .Can any one help me by giving the code for doing this.or any good related links so that i can do it.My final aim is that if more than one user is there, they browse the page thru url and find the results.

    Thanks in advance

    Comment

    • ramdil
      New Member
      • Dec 2007
      • 46

      #3
      Hi

      Thanks for the help.

      Comment

      Working...