Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    41

    Unanswered: reading from sql table ...

    hi i'm new to sql and asp and just most database stuff... right now... i have an asp page which loads a default html page...

    in the html page, there's a section where it reads from an sql database and reads the row/columns and returns it all in a table thats displayed in html on the page... in the table in sql.. theres about 600 rows.. but i have it split up sort of.. like for rows 1-100 i made a column called row_id and i have that as 1 for rows 1-199... then for rows 200-299 the row_id for all those rows is 2, and so on... is there a way in my html code to retrieve only certain rows given the row_id, say i only want to display rows 200-299 and i have the row_id 2, is there a way to display just those rows instead of the whole table of 600 rows?

    here is the code that reads sql table and shows it in html on a webpage, this code returns the whole table:

    Code:
    <czpage Project_Numbers Project everybody>
      <czdataset thisuser msaccess users query "select * from users where username = '%' " "user_id,username" "archuser:username" >
      <czdataset tnumbers intranet chargenumbers query "select * from chargenumbers order by task_number" "charge_id,project,task_number,description,project_id" "*:*" >
    <czbody>
      <czelement botmenu>
      <center>
         <table bgcolor="F0FFE0"><tr bgcolor="E0EEC0">
           <td><b>Charge ID</b></td>
           <td><center><b>Project</b></center></td>
           <td><b>Task Number</b></td>
           <td><b>Description</b></td>
           <td><b>Project ID</b></td></tr>
           <tr bgcolor="E0EEC0">
           <czform settasknums tnumbers charge_id multi>
           <td><czlink Tnumber_Detail "bluedot.gif" image withkey tnumbers charge_id popup 400 650 >
           <czfield tnumbers charge_id r></td>
           <td><czfield tnumbers project w small></td>
           <td><czfield tnumbers task_number w ></td>
           <td><czfield tnumbers description w large>
           <td><czfield tnumbers project_id w small><czsubmit write></td>
           <czinterform></tr><tr bgcolor="E0EEC0"></czform>
         </tr></table>
      </center>
      <czelement botfoot>
    </czbody>
    </czpage>
    chargenumbers is the name of the table,
    charge_id,project,task_number,description,project_ id are the name of the columns... right now i added an extra column called row_id and i want to be able to display only the rows that have a certain row_id..

    can anyone help please?
    (sorry for the long post)

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    in the same way that you have

    Code:
    <czpage Project_Numbers Project everybody>
      <czdataset thisuser msaccess users query "select * from users where username = '%' " "user_id,username" "archuser:username" >
    ...............
    can you have...


    Code:
    <czpage Project_Numbers Project everybody>
      <czdataset thisuser msaccess users query "select * from users where username = '%' and row_id='%' " "user_id,username" "archuser:username"  "row_id" "archrow_id" >
    ...............
    I'm not sure on the exact sytnax for this, I've never done it this way myself...

  3. #3
    Join Date
    Feb 2002
    Posts
    2,232
    Are you submitting back to this page to return the remaining results ? And what is the syntax for czdataset ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •