I wonder if the below use of between in the link is correct considering the scenario below
main.asp page
<a href="http://details.asp?number between 01 and 08>)
click here for number between 1 and 8
</a>
This is query in access
select * from table
where right("000" & number,2) between [enter start number] and [enter end number]
This is the Table in access
number| field1| field2| field3
1 | xys | abc | at
2 |sdfd | dfasd | dd
3 | sdfd | ddd | dd
The below is details.asp code
<html>
<body>
<%
Dim numCategoryID
numCategoryID = Request.Querystring("number")
set conn=Server.CreateObject("ADODB.Connection")
conn.open "query"
set rs = Server.CreateObject("ADODB.recordset")
strQuery = "queryname '" & numCategoryID & "'"
rs.Open strQuery, conn
%>
<table border="1" width="100%">
<tr>
<%for each x in rs.Fields
response.write("<th>" & x.name & "</th>")
next%>
</tr>
<%do until rs.EOF%>
<tr>
<%for each x in rs.Fields%>
<td><%Response.Write(x.value)%></td>
<%next
rs.MoveNext%>
</tr>
<%loop
rs.close
conn.close
%>
</table>
</body>
</html>
Please let me know if there is any mistake in the above codes. Actually when I click on the link main.asp, it should open the query where number between 1 and 8.
This is my third try to get output between two numbers when user enters the two numbers in form
<%
dim startnumber, endnumber
startnumber = Request.form("number")
endnumber = Request.form("number")
set conn=Server.CreateObject("ADODB.Connection")
conn.open "connection"
set rs = Server.CreateObject("ADODB.recordset")
strQuery = "SELECT * from query " _
& "where number between" & startnumber_
& "& endnumber;
rs.Open strQuery, conn
%>
<table border="1" width="100%">
<tr>
<%for each x in rs.Fields
response.write("<th>" & x.name & "</th>")
next%>
</tr>
<%do until rs.EOF%>
<tr>
<%for each x in rs.Fields%>
<td><%Response.Write(x.value)%></td>
<%next
rs.MoveNext%>
</tr>
<%loop
rs.close
conn.close
%>
</table>
</body>
</html>
Here a reworked version with some advise, it would surprise me if it works right a way, it’s just ot give you an idea, also the part about passing through a number and selection from the db is probably different from what you want, anyway check your requested parameter and only show the rest if the parameters are there with correct values, otherwise show a message
to test your database connection make an asp like this