Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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</p> <pre><code>'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 &lt;a href="http://details.asp?number=true&gt;) click here for number between 1 and 8 &lt;/a&gt; 'details.asp 'best not mix html with code, using one code block here w "&lt;html&gt;" w " &lt;body&gt;" 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=" &amp; Server.MapPath("\mydb.mdb") &amp; ";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 " &lt;table border='1' width='100%'&gt;" w " &lt;tr&gt;" for each x in rs.Fields w " &lt;th&gt;" &amp; x.name &amp; "&lt;/th&gt;" next w " &lt;/tr&gt;" do until rs.EOF w " &lt;tr&gt;" for each x in rs.Fields w " &lt;td&gt;" &amp; x.value &amp; "&lt;/td&gt;" next rs.MoveNext w " &lt;/tr&gt;" loop rs.close conn.close set conn = nothing 'close and cleanup your connection properly w " &lt;/table&gt;" else w "No parameter number found" end if w " &lt;/body&gt;" w "&lt;/html&gt;" '--- ---' sub w (text) response.write(text) &amp; VbCrLf end sub %&gt; </code></pre> <p>to test your database connection make an asp like this</p> <pre><code>&lt;% on error resume next connectionString = "DBQ=" &amp; Server.MapPath("\mydb.mdb") &amp; ";DRIVER={Microsoft Access Driver (*.mdb)};" set conn = Server.CreateObject("ADODB.Connection") conn.open ConnectionString if err.number &lt;&gt; 0 then response.write err.description else response.write "Connection was succesfull.." end if %&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload