Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8116257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:46:06+00:00 2026-06-06T03:46:06+00:00

I wonder if the below use of between in the link is correct considering

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:46:07+00:00Added an answer on June 6, 2026 at 3:46 am

    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

    'no sql parts in your url, just parameters with a value
    'this just indicates you want the numbers between 1 and 8, 
    'doesn't select a specific number, 
    'then you need eg a form with an input box in your main.asp page
    
    'main.asp
    <a href="http://details.asp?number=true>) 
     click here for number between 1 and 8 
    </a> 
    
    'details.asp
    'best not mix html with code, using one code block here
    w "<html>"
    w "  <body>"
    dim number, conn, rs, connectionstring, strQuery
    number = Request.Querystring("number")
    if number then
      'adapt the connectionstring for other versions of access and/or files
      connectionString = "DBQ=" & Server.MapPath("\mydb.mdb") & ";DRIVER={Microsoft Access Driver (*.mdb)};"
      set conn = Server.CreateObject("ADODB.Connection") 
      conn.open ConnectionString
      'best to not be dependent on a query, put your sql here
      'no need for an empty recordset first
      strQuery = "select * from table where number between 1 and 8;"
      set rs = conn.execute(strQuery)
    
      w "      <table border='1' width='100%'>"
      w "        <tr>"
      for each x in rs.Fields
        w "        <th>" & x.name & "</th>"
      next 
      w "        </tr>"
      do until rs.EOF
        w "      <tr>"
        for each x in rs.Fields
          w "      <td>" & x.value & "</td>"
        next 
        rs.MoveNext
        w "      </tr>"
      loop
    
      rs.close 
      conn.close
      set conn = nothing 'close and cleanup your connection properly
    
      w "    </table>"
    else
      w "No parameter number found"
    end if
    w "  </body>"
    w "</html>"
    '--- ---'
    sub w (text)
      response.write(text) & VbCrLf
    end sub
    %> 
    

    to test your database connection make an asp like this

    <%
    on error resume next
    connectionString = "DBQ=" & Server.MapPath("\mydb.mdb") & ";DRIVER={Microsoft Access Driver (*.mdb)};"
          set conn = Server.CreateObject("ADODB.Connection") 
          conn.open ConnectionString
    if err.number <> 0 then
      response.write err.description
    else
      response.write "Connection was succesfull.."
    end if
    %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wonder about how to update the table. I have use below two
I currently use mechanize to read gzipped web page as below: br = mechanize.Browser()
I have this db below. I wonder how I should use the ID to
I wonder if there is something wrong with the copy constructor function below? class
i wonder if i use google.load(jquery, 1); google.setOnLoadCallback(function() { // i still need to
I use PyYAML to work with YAML files. I wonder how I can properly
I wonder whether someone can help me please. I'm using the code below to
I wonder whether someone may be able to help me please. The code below
I wonder what is the best way to use substring function on a string
I wonder if anybody has been able to successfully use KiokuDB on Windows. Having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.