RecordSet Count

I am retrieving records from the database and need to populate them into a one dimensional Array.
I need to get the count of the RecordSet and then set the size of the Array.
Is there a method to know the number of rows retrieved into the RecordSet.
Thanks for your help.

You might want to try the JDBC forum instead, where this question is answered approximately once a week.

Similar Messages

  • How can I bring the recordset count inside the same recordset?

    I have a query inside a procedure where I'm paging the results.
    I dont know how to bring the total results inside the recordset.
    How can I bring the recordset count inside the same recordset?
    SELECT *
    FROM ( select a.*, rownum rnum
         FROM (SELECT
              FROM table
              ORDER BY id DESC) a
         WHERE rownum <= pg*50 )
    WHERE rnum > (pg-1)*50

    My query is much more comples, so that is why I'm using the other script.
    When I included the "COUNT(*) OVER() tot_cnt AS total" it didn't worked:
    ORA-00904: "TOT_CNT": invalid identifier
    What is the tot_cnt?
    SELECT *
    FROM (SELECT a.*, rownum rnum
    FROM (SELECT
    ed_fotos.id AS COD_FOTO,
    ed_fotos.arquivo AS NOM_ARQUIVO,
    ed_areas.nome AS NOM_REDACAO,
    COUNT(*) OVER() tot_cnt AS total
    FROM edt.ed_fotos ed_fotos
    INNER JOIN edt.ed_volumes ed_volumes ON ed_volumes.id = ed_fotos.volume_id
    INNER JOIN edt.ed_caminhos path_alta ON path_alta.id = ed_volumes.caminho1
    INNER JOIN edt.ed_caminhos path_baixa ON path_baixa.id = ed_volumes.caminho2
    INNER JOIN edt.ed_areas ed_areas ON ed_areas.id = ed_fotos.redacao_id
    ORDER BY id DESC) a
    WHERE rownum <= 200 )
    WHERE rnum >= 100

  • Showing a date listing from recordset, how to fill in dates not listed?

    I have been several different directions on this, but this may work.
    I am trying to list a date range like Nov 1 through Nov 8, ie Nov1, Nov2, Nov3, etc and under each date show a recordset COUNT for that date and if there is no record matching that date, show 0 .
    I have this sql
    mysql_select_db($database_connbubba, $connbubba);
    $query_rs_count = "SELECT yard_sales.yardsale_date,DATE_FORMAT(yard_sales.yardsale_date, '%b %d') AS theDate,COUNT(*) FROM yard_sales WHERE yard_sales.yardsale_date>=CURDATE() GROUP BY yard_sales.yardsale_date";
    $query_limit_rs_count = sprintf("%s LIMIT %d, %d", $query_rs_count, $startRow_rs_count, $maxRows_rs_count);
    $rs_count = mysql_query($query_limit_rs_count, $connbubba) or die(mysql_error());
    $row_rs_count = mysql_fetch_assoc($rs_count);
    user posts their yard sale information into the db and column yardsale_date is date YYYY-MM-DD
    so with this setup, i have a table with 2 rows (rs_count.theDate and rs_count.COUNT) and the table repeats horizontally.
    so the result is
         Nov2                  Nov6                   Nov8
    1 Yard Sale          2 Yard Sale         1 Yard Sale
    How can i get
         Nov2                 Nov3                   Nov4                 Nov5                   Nov6                      Nov7                  Nov8
    1 Yard Sale         0 Yard Sale         0 Yard Sale       0 Yard Sale         2 Yard Sale          0 Yard Sale        1 Yard Sale
    thanks for your help,
    jim balthrop

    You can't show data that does not exist, so you first need to create another calendar table that includes all possible dates. You can then outer join that table to your main table. Pull the dates from the calendar table and count the number of sales in your main table. Group by calendar table dates.

  • Can't get total recordset

    Set Rec_cmd = Server.CreateObject ("ADODB.Command")
    Rec_cmd.ActiveConnection = MM_conndb_STRING
    Rec_cmd.CommandText = "SELECT * FROM tbl"
    Rec_cmd.Prepared = true
    Set Rec = Rec_cmd.Execute
    This is common DW Recordset soruce code, I am pretty sure there is over 10 datas in table
    but when I use Response.Write Rec.RecordCount, it's always response -1
    therefore move to next or previous page funcion will be failed, let alone some page navigation funciton
    my database was access, and this is my connection string
    MM_conndb_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\db\db.mdb")
    why can't I get recordset count?

    Hi,
    I haven't used Branch Aware(ness?) yet. Hmm..I will look into it. Thanks!  I'm using 7, so I'll have to check it out.
    Thanks for the quick response.
    Elizabeth

  • Recordset from count of records (field in Access DB)

    I'm creating an application with DW CS3 using ASP VBscript
    and an Access database. Users will be able to register to attend a
    session on one of a number of dates. Upon submitting a form, their
    contact info and choice of date will be input into an Access table
    called registrants. The field 'regDate' within the table
    'registrants' will contain the dates that each user selected.
    I want to be able to close registrations when 85 people have
    selected a date. I thought I would do that by creating a recordset
    in DW that only displayed dates with less than 86 registrants so
    that people cannot select a date that has been filled. A DW form
    inputs into the 'registrants' table as a field of each registrant's
    record; but I don't have a table in Access that displays the number
    of people who registered for each date and can't quite figure out
    the best way to get that number and utilize it in DW. I want to
    utilize that count by creating a recordset that will include only
    dates that have less than 86 registrants.
    I created a query in MS Access that displays each of the
    registration dates and the number of people who selected that date.
    I don't know the best way to transfer that and use it in DW.
    Following is the Access query that gives me the number of
    registrants per date. Can the SQL be modified to work in a
    recordset within DW? It doesn't work to paste it directly because I
    guess it's a different kind of SQL language.
    SELECT registrants.regDate, Count(registrants.regDate) AS
    CountOfregDate INTO Registrations
    FROM registrants
    GROUP BY registrants.regDate;

    That would be a MS Access question. Try their forums. I take it u want to set it dynamically within JAVA. Otherwise to set the description in Access DB; right click on table and design view :D But I know thats not what ur after.

  • Urgent help!!how to count the no of fields retrieved by recordset??

    hello friends,
    i need to count the no of fields and not rows returned by the recordset
    plz. help me soon,
    Ex. rs.executeQuery("select * from table");
    now how many columns will be there in the table,i need to know that
    thanx in advance,its urgent so reply soon,
    Vishal

    hey, i am getting an error as follows
    cannot resolve symbol
    symbol : method getMetaData (java.lang.String)
    location: class front1
    ResultSetMetaData rmd= getMetaData(globals.s);
    ^
    1 error
    can u expand the code a bit , so this error is solved ?
    thanx again

  • How to count the no of fields returned by recordset?

    hi friends,
    how can i know how many columns have been returned by the recordset
    ex. rs.executeQuery("select * from table");
    now how many columns r there in the table, can this be known?
    thanx in advance,
    Vishal

    ResultSetMetaData rsmd = rs.getMetaData();
    int columnCount = rsmd.getColumnCount();ResultSetMetaData will provide you with a great deal of information about the ResultSet - check out the API here: http://java.sun.com/j2se/1.4.1/docs/api/java/sql/ResultSetMetaData.html
    Hope this helps!

  • Recordsets with multiple options - AND, OR If Else and the "Any" Rule

    Hi,
    Been trying to get this to work for days now... I have a form with drop down lists that feeds through variables to a search page... The Recordset Jobsearch2 shown below works great so long as a user chooses and option that has info in the DB.... ie all fields must be present. I cannot seem to work out how to achieve and Any rule?...
    I have had 2 options suggested to me...
    a) the code below...
    if(isset($searchsector) && $searchsector !== "") {
    $query_jobsearch2 .= ' AND Sector LIKE "%' . mysql_real_escape_string($searchsector) . '%"';
    putting this in for each option..... but If Im told I have to add this in before the "$jobsearch2 = mysql_query" line... but when I do this the recordset disappears\is deleted...
    b) Using an Array and "Implode" -  this wouldbe great I'm sure if I had any clue how to do this and what it meant.
    MY CURRENT CODE
    <?php require_once('Connections/steelbakercouk_473245_db1.php'); ?>
    <?php
    $searchsector = $_POST['Sector'];
    $searchlocation = $_POST['clocation'];
    $searchmin = $_POST['minsalary'];
    $searchmax = $_POST['maxsalary'];
    $searchtype = $_POST['Type'];
    ?>
    <?php
    mysql_select_db($database_steelbakercouk_473245_db1, $steelbakercouk_473245_db1);
    $query_jobsearch2 = "SELECT jobs.clocation, jobs.Ref_id, jobs.RefCode, jobs.jobtitle, jobs.blurb, jobs.Consultant, jobs.Salary, jobs.tlocation, jobs.Sector, jobs.Type FROM jobs WHERE jobs.Salary BETWEEN '$searchmin' AND '$searchmax' AND clocation = '$searchlocation' AND jobs.Sector  = '$searchsector' AND jobs.Type = '$searchtype'";
    $jobsearch2 = mysql_query($query_jobsearch2, $steelbakercouk_473245_db1) or die(mysql_error());
    $row_jobsearch2 = mysql_fetch_assoc($jobsearch2);
    $totalRows_jobsearch2 = mysql_num_rows($jobsearch2);
    ?>
    Please help... ... pulling my hair out!
    Thanks

    Ok.. I've tried all methods and still not getting anywhere..
    David... following the link you gave me... and to the letter.. apart from GetSQLValueString()which does not seem to exist.
    All it does is return all the records (as per the basic recordset)
    Heres the code.... please please tell me where I am going wrong.... downloaded your book Foundation PHP but struggaling.,
    <?php require_once('Connections/steelbakercouk_473245_db1.php'); ?>
    <?php
    $searchsector = $_POST['Sector'];
    $searchlocation = $_POST['clocation'];
    $searchmin = $_POST['minsalary'];
    $searchmax = $_POST['maxsalary'];
    $searchtype = $_POST['Type'];
    $any = $_POST['any'];
    ?>
    <?php
    $currentPage = $_SERVER["PHP_SELF"];
    mysql_select_db($database_steelbakercouk_473245_db1, $steelbakercouk_473245_db1);
    $expected = array('Sector' => 'text',
                      'clocation'         => 'text',
                      'minsalary'          => 'int',
                      'maxsalary'      => 'int');
    $query_jobsearch2 = "SELECT jobs.clocation, jobs.Ref_id, jobs.RefCode, jobs.jobtitle, jobs.blurb, jobs.Consultant, jobs.Salary, jobs.tlocation, jobs.Sector, jobs.Type FROM jobs";
    $where = false;
    // Loop through the associatiave array of expected search values
    foreach ($expected as $var => $type) {
      if (isset($_GET[$var])) {
        $value = trim(urldecode($_GET[$var]));
        if (!empty($value)) {
          // Check if the value begins with > or <
          // If so, use it as the operator, and extract the value
          if ($value[0] == '>' || $value[0] == '<') {
            $operator = $value[0];
            $value = ltrim(substr($value, 1));
          } elseif (strtolower($type) != 'like') {
            $operator = '=';
          // Check if the WHERE clause has been added yet
          if ($where) {
            $query_search .= ' AND ';
          } else {
            $query_search .= ' WHERE ';
            $where = true;
          // Build the SQL query using the right operator and data type
          $type = strtolower($type);
          switch($type) {
            case 'like':
              $query_search .= "`$var` LIKE " . GetSQLValueString('%' .
    $value . '%', "text");
              break;
            case 'int':
            case 'double':
            case 'date':
              $query_search .= "`$var` $operator " .
    GetSQLValueString($value, "$type");
              break;
            default:
            $query_search .= "`$var` = " . GetSQLValueString($value,
    "$type");
    $jobsearch2 = mysql_query($query_jobsearch2, $steelbakercouk_473245_db1) or die(mysql_error());
    $row_jobsearch2 = mysql_fetch_assoc($jobsearch2);
    $totalRows_jobsearch2 = mysql_num_rows($jobsearch2);
    $queryString_jobsearch2 = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_jobsearch2") == false &&
            stristr($param, "totalRows_jobsearch2") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_jobsearch2 = "&" . htmlentities(implode("&", $newParams));
    $queryString_jobsearch2 = sprintf("&totalRows_jobsearch2=%d%s", $totalRows_jobsearch2, $queryString_jobsearch2);
    ?>

  • Not able to retrive the recordset from oracle stored procedure in VC++

    Hi,
    I am trying to retrieve the records from the reference cursor which is an out parameter for an oracle 9i store procedure in VC++ application. But it is giving the record count as -1 always. Meanwhile i am able to get the required output in VB application from the same oracle 9i store procedure .
    Find the code below which i used.
    Thanks,
    Shenba
    //// Oracle Stored Procedure
    <PRE lang=sql>CREATE OR REPLACE
    PROCEDURE GetEmpRS1 (p_recordset1 OUT SYS_REFCURSOR,
    p_recordset2 OUT SYS_REFCURSOR,
    PARAM IN STRING) AS
    BEGIN
    OPEN p_recordset1 FOR
    SELECT RET1
    FROM MYTABLE
    WHERE LOOKUPVALUE > PARAM;
    OPEN p_recordset2 FOR
    SELECT RET2
    FROM MYTABLE
    WHERE LOOKUPVALUE >= PARAM;
    END GetEmpRS1;</PRE>
    ///// VC++ code
    <PRE lang=c++ id=pre1 style="MARGIN-TOP: 0px">ConnectionPtr mpConn;
    _RecordsetPtr pRecordset;
    _CommandPtr pCommand;
    _ParameterPtr pParam1;
    //We will use pParam1 for the sole input parameter.
    //NOTE: We must not append (hence need not create)
    //the REF CURSOR parameters. If your stored proc has
    //normal OUT parameters that are not REF CURSORS, you need
    //to create and append them too. But not the REF CURSOR ones!
    //Hardcoding the value of i/p paramter in this example...
    variantt vt;
    vt.SetString("2");
    m_pConn.CreateInstance (__uuidof (Connection));
    pCommand.CreateInstance (__uuidof (Command));
    //NOTE the "PLSQLRSet=1" part in
    //the connection string. You can either
    //do that or can set the property separately using
    //pCommand->Properties->GetItem("PLSQLRSet")->Value = true;
    //But beware if you are not working with ORACLE, trying to GetItem()
    //a property that does not exist
    //will throw the adErrItemNotFound exception.
    m_pConn->Open (
    bstrt ("Provider=OraOLEDB.Oracle;PLSQLRSet=1;Data Source=XXX"),
    bstrt ("CP"), bstrt ("CP"), adModeUnknown);
    pCommand->ActiveConnection = m_pConn;
    pParam1 = pCommand->CreateParameter( bstrt ("pParam1"),
    adSmallInt,adParamInput, sizeof(int),( VARIANT ) vt);
    pCommand->Parameters->Append(pParam1);
    pRecordset.CreateInstance (__uuidof (Recordset));
    //NOTE: We need to specify the stored procedure name as COMMANDTEXT
    //with proper ODBC escape sequence.
    //If we assign COMMANDTYPE to adCmdStoredProc and COMMANDTEXT
    //to stored procedure name, it will not work in this case.
    //NOTE that in the escape sequence, the number '?'-s correspond to the
    //number of parameters that are NOT REF CURSORS.
    pCommand->CommandText = "{CALL GetEmpRS1(?)}";
    //NOTE the options set for Execute. It did not work with most other
    //combinations. Note that we are using a _RecordsetPtr object
    //to trap the return value of Execute call. That single _RecordsetPtr
    //object will contain ALL the REF CURSOR outputs as adjacent recordsets.
    pRecordset = pCommand->Execute(NULL, NULL,
    adCmdStoredProc | adCmdUnspecified );
    //After this, traverse the pRecordset object to retrieve all
    //the adjacent recordsets. They will be in the order of the
    //REF CURSOR parameters of the stored procedure. In this example,
    //there will be 2 recordsets, as there were 2 REF CURSOR OUT params.
    while( pRecordset !=NULL ) )
    while( !pRecordset->GetadoEOF() )
    //traverse through all the records of current recordset...
    long lngRec = 0;
    pRecordset = pRecordset->NextRecordset((VARIANT *)lngRec);
    //Error handling and cleanup code (like closing recordset/ connection)
    //etc are not shown here.</PRE>

    It can be linked to internal conversion. In some case, the value of internal or extranal value is not the same.
    When you run SE16 (or transaction N), you have in option mode the possibility to use the exit conversion or not.
    Christophe

  • Showing column value as counter in sql query - report

    I created a classic report with search bar based on an sql query. I would like to show the "notes" column in this query using some sort of counter and as a hyperlink to another section on the page (same idea as footnotes in a book). So if I have 10 rows and 5 have "notes". I should show 1,2,3,4,5 in the notes column for those rows and the number gets displayed as a link to another section listing the notes 1 through 5.
    I was thinking of creating a hidden page item as the counter with value of 0 and then in my query doing counter+1 but i'm not sure how to do this or if i can do that...
    If anyone can help or have any other ideas I would really appreciate it!!
    Thanks,
    Hindy

    Well, I'm doing this in VB and the subquery is dynamic. I'm passing an ADO recordset to a routine that sets up a listview to display the results. The number of columns selected can vary. My idea was to size the columns appropriately based on the size of the data. Within the display routine I could:
    sql = "SELECT "
    for i = 0 to oRS.Fields.Count - 1
    sql = sql & "MAX(LENGTH(" & i & ")), "
    next 'i
    sql = sql & "FROM (" & oRS.Source & ")"

  • How do I get a recordset to display three images horizontally?

    Hi,
    I'm using DWCS3 with MAMP.
    I want to display three images horizontally in a recordset. I have downloaded Tom Muck's extension horizontal looper and followed the instructions.
    However when I tried to add the recordset navigation bar I ran into some problems.
    If I add a repeat region to Tom Muck's extension then the page doesn't load.
    If I don't add a repeat region to Tom's extension everything works really well except only one image displays rather than three.
    Here is all of my code for the page. 
    Could someone help me please.
    <?php require_once('Connections/connQuery.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $currentPage = $_SERVER["PHP_SELF"];
    $maxRows_rshlimgs = 1;
    $pageNum_rshlimgs = 0;
    if (isset($_GET['pageNum_rshlimgs'])) {
      $pageNum_rshlimgs = $_GET['pageNum_rshlimgs'];
    $startRow_rshlimgs = $pageNum_rshlimgs * $maxRows_rshlimgs;
    mysql_select_db($database_connQuery, $connQuery);
    $query_rshlimgs = "SELECT * FROM image";
    $query_limit_rshlimgs = sprintf("%s LIMIT %d, %d", $query_rshlimgs, $startRow_rshlimgs, $maxRows_rshlimgs);
    $rshlimgs = mysql_query($query_limit_rshlimgs, $connQuery) or die(mysql_error());
    $row_rshlimgs = mysql_fetch_assoc($rshlimgs);
    if (isset($_GET['totalRows_rshlimgs'])) {
      $totalRows_rshlimgs = $_GET['totalRows_rshlimgs'];
    } else {
      $all_rshlimgs = mysql_query($query_rshlimgs);
      $totalRows_rshlimgs = mysql_num_rows($all_rshlimgs);
    $totalPages_rshlimgs = ceil($totalRows_rshlimgs/$maxRows_rshlimgs)-1;
    $queryString_rshlimgs = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_rshlimgs") == false &&
            stristr($param, "totalRows_rshlimgs") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_rshlimgs = "&" . htmlentities(implode("&", $newParams));
    $queryString_rshlimgs = sprintf("&totalRows_rshlimgs=%d%s", $totalRows_rshlimgs, $queryString_rshlimgs);
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <link href="styles/orderlist3.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="lightbox_assets/css/lightbox.css" type="text/css" media="screen" />
    <script src="lightbox_assets/js/prototype.js" type="text/javascript"></script>
    <script src="lightbox_assets/js/scriptaculous.js?load=effects" type="text/javascript"></script>
    <script src="lightbox_assets/js/lightbox.js" type="text/javascript"></script>
    <style type="text/css">
    <!--
    a:link {
    color: #999966;
    a:visited {
    color: #FFFFFF;
    a:hover {
    color: #006600;
    a:active {
    color: #666699;
    -->
    </style></head>
    <body class="oneColFixCtrHdr" onload="initLightbox()">
    <div id="container">
      <div id="header">
        <h1>Header</h1>
      <!-- end #header --></div>
      <div id="mainContent">
        <h3>Image catalog</h3>
        <p> </p>
        <table >
          <tr>
            <?php
    $rshlimgs_endRow = 0;
    $rshlimgs_columns = 3; // number of columns
    $rshlimgs_hloopRow1 = 0; // first row flag
    do {
        if($rshlimgs_endRow == 0  && $rshlimgs_hloopRow1++ != 0) echo "<tr>";
       ?>
            <td><p><a href="images/weddingprivate/mr_and_mrs_lowe_18_15.jpg" title="Mr and Mrs Lowe_18_15" rel="lightbox"><img src="<?php echo $row_rshlimgs['imagethumb_url']; ?>" alt="The bride to be getting ready" longdesc="http://The bride to be with her hairdresser" width="100" height="150" /></a></p>
                <p><?php echo $row_rshlimgs['caption']; ?> <img src="images/Untitled-1.gif" alt="spacer" width="170" height="1" /></p>
              <p> </p>
              <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
                  <input type="hidden" name="cmd" value="_s-xclick" />
                  <input type="hidden" name="hosted_button_id" value="6782561" />
                  <table>
                    <tr>
                      <td><input type="hidden" name="on0" value="Sizes" />
                        Sizes</td>
                    </tr>
                    <tr>
                      <td><select name="os0">
                          <option value="6x4">6x4 £3.00 </option>
                          <option value="7x5">7x5 £5.00 </option>
                          <option value="12x8">12x8 £6.50 </option>
                        </select>
                      </td>
                    </tr>
                  </table>
                <input type="hidden" name="currency_code" value="GBP" />
                  <input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online." />
                  <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1" />
              </form></td>
            <?php  $rshlimgs_endRow++;
    if($rshlimgs_endRow >= $rshlimgs_columns) {
      ?>
          </tr>
    <?php
    $rshlimgs_endRow = 0;
    } while ($row_rshlimgs = mysql_fetch_assoc($rshlimgs));
    if($rshlimgs_endRow != 0) {
    while ($rshlimgs_endRow < $rshlimgs_columns) {
        echo("<td> </td>");
        $rshlimgs_endRow++;
    echo("</tr>");
    }?>
        </table>
        <table border="0">
          <tr>
            <td><?php if ($pageNum_rshlimgs > 0) { // Show if not first page ?>
                  <a href="<?php printf("%s?pageNum_rshlimgs=%d%s", $currentPage, 0, $queryString_rshlimgs); ?>"><img src="images/First.gif" border="0" /></a>
                  <?php } // Show if not first page ?>
            </td>
            <td><?php if ($pageNum_rshlimgs > 0) { // Show if not first page ?>
                  <a href="<?php printf("%s?pageNum_rshlimgs=%d%s", $currentPage, max(0, $pageNum_rshlimgs - 1), $queryString_rshlimgs); ?>"><img src="images/Previous.gif" border="0" /></a>
                  <?php } // Show if not first page ?>
            </td>
            <td><?php if ($pageNum_rshlimgs < $totalPages_rshlimgs) { // Show if not last page ?>
                  <a href="<?php printf("%s?pageNum_rshlimgs=%d%s", $currentPage, min($totalPages_rshlimgs, $pageNum_rshlimgs + 1), $queryString_rshlimgs); ?>"><img src="images/Next.gif" border="0" /></a>
                  <?php } // Show if not last page ?>
            </td>
            <td><?php if ($pageNum_rshlimgs < $totalPages_rshlimgs) { // Show if not last page ?>
                  <a href="<?php printf("%s?pageNum_rshlimgs=%d%s", $currentPage, $totalPages_rshlimgs, $queryString_rshlimgs); ?>"><img src="images/Last.gif" border="0" /></a>
                  <?php } // Show if not last page ?>
            </td>
          </tr>
        </table>
        <p> </p>
            <p> </p>
      <!-- end #mainContent --></div>
      <div id="footer">
        <p>Footer</p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    </body>
    </html>
    <?php
    mysql_free_result($rshlimgs);
    ?>

    Hi Charles,
    Use [Dr%] Variable formula as =if(IsNull([Dr%]);0;[DR%])
    Here IsNull returns the Boolean value of variable [Dr%] if its true then inserts 0 else the percentage values of failed tests based on the  total number of assembly tests performed.
    I Hope this is what you want to achieve....
    Thanks....
    Pratik

  • Looking for a better way to count responses to survey questions

    Hello all - I've created a survey for a site and now want to display the results for the site admins. I am simply trying to display the counts - the number of times a question has been answered a certain way. I realize that I may need to construct the survey itself differently and how it stores the data, but here's how it goes so far.
    There are 10 questions, each with 4 options in radio button groups. The database table has a column for each question and stores the value of the selected radio button. So that's pretty simple.
    Now on the results page this is the only way I can think of doing it, but there has to be a better way. For each response, I create a recordset filtered on the question and option value, then display the total record count. That works just fine, but to count each option, that means 40 recordsets on the page - al to merely determine "How many times was Question 1, Option A selected, and How many times was Question 1, Option B selected, and so on.
    The only other thing I can think of, there perhaps is a better way to count the occurrences of these values in the table either with PHP or in the SQL itself.  Or, perhaps if the values themselves are all numeric and follow some sort of pattern I can use a math solution.
    Any thoughts, solutions and ideas are welcome!  Thanks. 

    THANK YOU!!
    I used this format before actually for an exam in an online training program, and I don't know why I didn't make the connection.
    I also want to connect the responses to the participant, but I think that would even be secondary to the survey itself.
    So just to clarify, if you would, I would have a survey table l like I do now, with each survey generating an ID with each one and perhaps the user info or a column for User ID. Then, the questions table each with an ID to populate the questions, a options table, each with its own ID and linked to the questions that populate the options.
    Finally a responses table that records the Survey ID, Question ID and Option ID with each record.
    In the exam I did before, the questions and responses were in the same table, so I suppose I could make it work that way too. But, now I know why I didn't think of this - unlike the exam where each question was presented one at a time, the survey is on a single page and would require a multiple record insert - which I haven't done as much as single inserts, so it didn't pop into the head.
    L

  • Error creating user defined tables: Ref count (-1120)

    Hi all !
    I have to create user defined tables per code, so I wrote <b>2 main functions</b>, first <i>to create a table</i> (with TableName,TableType and TableDescription properties)and  and <i>second to add fields</i> (to a certain table which is sent as parameter).
    I call these functions to create multiple tables. For the first 6 tables it works totally ok. But beginning from the 7th table it gives that "<b>Ref count for this object is higher then 0.</b> " (-1120) error. All parameters are ok just as the first 6 tables.
    Found such an explanation like below in help files.
    <i>The DI API allows only one instance of a meta data object at a time. This maintains data integrity by preventing any manipulation of a business object while modifying the object's user fields. Therefore, verify that no other DI object is active except the meta data object.</i>
    But why do I get such an error after sixth call of the function (but not beginning from the second table )?

    Gül,
    Have you tried doing some grbage collection?
    Search for a topic: "Add Usertables and Fields while having a recordset"
    HTH
    Juha

  • How to determine number of records in recordset returned by stored procedure?

    In TestStand 3.0 I am calling an SQL stored procedure where the stored
    procedure returns a recordset. Everything appears to work (I can
    iterate through the recordset and see that the data is valid).
    However, I can not figure out how to easilly determine how many
    records are actually in the recordset. Unlike the 'Open SQL
    Statement' step, in the 'Data Operation' step that actually invokes
    the stored procedure, there is no 'Number of Records Selected' option
    to specify a TestStand variable to accept this value. I know I could
    iterate through the returned recordset incrementing a counter until a
    Fetch fails, but for larger recordsets, traversing the table multiple
    times would be quite time consuming
    . I am hoping to avoid this if
    possible. Is there an easier way to get the number of records in a
    recordset returned from a stored procedure call?
    Bob

    Bob -
    The cursor type of the ADO Recordset object affects whether the number of records can be determined. The Recordset.RecordCount property will return -1 for a forward-only cursor; the actual count for a static or keyset cursor; and either -1 or the actual count for a dynamic cursor, depending on the data source.
    Because ADO does not let me set the cursor type for command objects which is what a stored procedure requires, it is up to the data source to determine the type of cursor and the support for record count.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

  • Word 2007 VBA - Can't Move around in a Recordset - From a Beginner

    [reposted from the VB.net forum where I mistakenly posted it]
    Hi,
    This is a simple program.  The issue is that Recordset.MoveNext and .MovePrevious aren't working, though .MoveFirst and MoveLast are.  If I exchange MoveLast for MoveNext and MovePrevious to MoveNext, the output will be 8 repetitions of the last record
    as compared to the first.  Counter will be 0 for each output starting with MoveFirst and 7 starting with MoveLast (which is interesting since I read that the AbsolutePosition property is supposed to be 1-based).  Any help will be appreciated!  The
    recordset is default (table-based) but this issue remained when I changed it to a dynaset recordset.
    Following is the code:
    Private Sub CmbOffices_Click()
        Call WordEx 'opens a Word doc and sets database objects
        Dim Counter As Long
        Dim intComboItem As Integer
        Set objSelection = objWord.Selection
        objSelection.TypeText ("STUFF") & vbCrLf
        For intComboItem = 0 To CmbOffices.ListCount - 1
            recordset.MoveFirst
            Counter = recordset.AbsolutePosition
                objSelection.TypeText field.Value & field2.Value & field3.Value & Counter &
    vbCrLf
                  'Else
            recordset.MoveNext
            'End If
        Next
        recordset.Close
        db.Close
    End Sub
    Chiroacuman

    Hi Gill,
    Thanks for helping me with this.  I forgot to mention that I have spent a lot of time on the net and here trying to find a solution.  Here is the code where I defined variables:
    [General Declarations in a classic Module]
    Public db As DAO.Database
        Public recordset As DAO.recordset
        Public field As DAO.field
        Public field2 As DAO.field
        Public field3 As DAO.field
    Public Sub WordEx()
        Set objWord = CreateObject("Word.Application")
        Set objDoc = objWord.Documents.Add
        Set db = CurrentDb
        Set recordset = db.OpenRecordset("Headers", dbOpenDynaset)
        Set field = recordset.Fields(0)
        Set field2 = recordset.Fields(1)
        Set field3 = recordset.Fields(2)
        objWord.Visible = True
    End Sub
    Chiroacuman

Maybe you are looking for

  • Oracle Open interface- Error in Item Import (INCOIN)

    Hi, I am migrating items to oracle using oracle open interface. I am getting the follwing errors. 1. The TEMPLATE_ID or TEMPLATE_NAME specified is not valid for this Organization 2. The revision entered is for an item that does not exist in MTL_SYSTE

  • Download spry table for Dreamweaver CS5

    Hi All, I have upgraded to dreamweaver CS5 recently. However, I cannot find the spry table in the menu. Where can I download the spry table from interenet? Thanks for help Kenny

  • My iphone 4s got the error 11 when trying to update software while in itunes help!!

    Help!!!!!    While trying to update my iphone 4 in itunes, it crashed and i got the error message 11!!! Nothing is happening, it won't restart, I can't turn it off.  Nothing will recognize it!!!

  • Resource trouble

    Hi, I am pretty new to Solaris 9 (december 2003 edition) x86 and want to install it on a VIA EPIA-M mini-itx motherboard with everything on-board. Boot from cdrom succeeded, but when it displays Bus Enumeration Determining bus types and gathering har

  • Significant Hard drive memory lost? Constantly changing in front of me.

    Hello, I have just been warned that my harddrive space is running low on my 1 and a half year old macbook pro, when last time I checked, about 2 days ago, I had over 70GB, but now I have around 700mb, and the numbers are going up and down right in fr