Help On Recordset

Hi,
I used to programm in ASP,and now i want to it in JSP
In ASP you can set the size of the recordset page i.e rs2.PageSize = 50 and it only loop through 50 record
and rs.PageCount gets you number of pages i.e the whole records divided by page size.
is there similiar way to JSP..
PLs Help ..........

<%
int pageSize = 5;//No of Records Shown in a Page
int pageCount=0; // Total No of Pages
int recordCount=0; // Total No of Records in the DataBase
int startNo=0; // Starting Record to be displayed.
int endNo=0; // End No to be displayed
int pageNo=0; // Page No
int i=0; // Used in forLoop
int count = 0;//to count record number
if(request.getParameter("Page")!=null)
session.setAttribute("Page",request.getParameter("Page"));
if(session.getAttribute("Page") == null)
pageNo=1;
else
pageNo=Integer.parseInt(session.getAttribute("Page").toString().trim());
sql = "Select * from threadeddiscussion b where b.tdIdSystem='"+id+"' and b.tdStatus=0 and b.userID='"+username+"' and TO_DAYS(NOW())-TO_DAYS(b.tdDate)<=90 order by b.tdID desc";
rs = stmt.executeQuery(sql);
while(rs.next())
count++;
recordCount = count;
if (pageNo>1 && recordCount<=pageSize*(pageNo-1))
pageNo=pageNo-1;
session.setAttribute("Page",Integer.toString(pageNo));
if (recordCount!=0)
pageCount = recordCount/pageSize;
if(recordCount%pageSize!=0) pageCount++;
startNo = ((pageNo-1) * pageSize) + 1;
endNo = (pageNo==pageCount) ? recordCount : (pageNo * pageSize);
rs = stmt.executeQuery(sql);
if (recordCount!=0){
for(i=1; i<startNo; i++)
rs.next();
while((rs.next()) && (startNo<=endNo)){
startNo++;
rs.getString();
%>
<!-- -------------------------------START OF Paging OWN MESSAGE START OF------------------------------------------- -->
<table width="90%" align="center" class="content">
<tr valign="top">
<td height="48" align="center">
<%if (recordCount!=0) {
if (pageNo!=1) {%>
[ <A HREF="edList.jsp?Page=1"#own>First Page</A> ]
<% } else {%>
<font color="#CCCCCC">[ First Page ]</font>
<% } %>
<%if (pageNo!=1 && pageNo!=2){%>
[ <A HREF="edList.jsp?Page=<%= pageNo-1%>"#own>Previous</A> ]
<% } else {%>
<font color="#CCCCCC">[ Previous ]</font>
<% } %>
<% } %>
<%if (recordCount!=0) {
if (pageNo!=pageCount && pageNo!=(pageCount-1)) {%>
[ <A HREF="edList.jsp?Page=<%= pageNo+1%>"#own>Next</A> ]
<% } else {%>
<font color="#CCCCCC">[ Next ]</font>
<% }%>
<%if (pageNo!=pageCount) {%>
[ <A HREF="edList.jsp?Page=<%= pageCount%>"#own>Last Page</A> ]
<% } else {%>
<font color="#CCCCCC">[ Last Page ]</font>
<% } %>
<%} %>
<% if (recordCount==0) {%>
<font color="#CCCCCC">[ First Page ] [ Previous ][ Next ][ Last Page ]</font>
<% } %>
</td>
</tr>
</table>
<!-- ---------------------------------END OF Paging OWN MESSAGE END OF--------------------------------------------- -->
<%

Similar Messages

  • Please help with RecordSet Query

    Hello all. I am trying to build a contact management system
    for different offices. Each person has a login they use to access
    their office's respective page. What I am wanting to do is pull up
    all the employees' information that work at the same location as
    the person who logged in. For example: Person A, B, and C work at
    Location 1 and Person X, Y, and Z work at location Z. If person A
    logs in, I want the to be able to see the dynamic table with the
    information for all of Location 1 (Person A, B, and C). I
    understand using the session variable MM_Username to filter the
    recordsets based off who logs in. Where I'm confused is in pulling
    up the records for everyone that shares the same location as the
    person who logs in. In other words, if I say filter Information
    based off Session Variable MM_Username it only returns the
    information for the person who logged in. I want it to say, in
    layman terms, Person A logged in, now look at their location, and
    return all Person's information who has a location equal to that of
    Person A. I hope I explained my dilemma clearly enough. If I need
    to elaborate or explain any more please let me know. Thanks in
    advance for any and all help.

    Thank you for your help. Sorry for my ignorance, but I'm
    still confused. I've made some changes to hopefully help. I have 1
    SQL table (called "Employees") with TableID, Username, Password,
    AccessLevel, and LocationID. I have another table (called
    "Names"-for testing purposes) with just TableID, Name, and
    LocationID. The query that I built, which doesn't work, is:
    SELECT `Names`.`Names`
    FROM Employees, `Names`
    WHERE Employees.Store_Number = `Names`.Store_Number
    I'm wanting it to simply display the names from the Names
    table that share the same LocationID as in the Employees Table. I
    realize that at this point it should just be a list of all the
    employee names from the Names table, but what it's doing is
    actually displaying 2 of every name. What do I need to do to set
    this up to where the MM_Username Session Variable generated at
    login grabs the LocationID from the Employee Table, then uses that
    LocationID and displays all the names from the Names Table with
    that same LocationID? I'm sorry for my lack of understanding, and I
    really appreciated the help.
    As a side note, why are there apostrophes around the Name
    Table but not the Employees Table in the query window? Thank you
    again.

  • Need Help with RecordSet Query

    I need some major help please. Gettin really frustrated here.
    From my search page, if I do not fill out any fields and hit
    SUBMIT, all records in the recordset are being displayed. Why? I
    have a default value set to '.' There should be no matches. I just
    don't understand. Can someone explain it to me?
    Help me obi-wan!

    been hashing at this all eve and haven't figured out why it
    is doing this so......
    here is my form:
    <body>
    <form id="form1" method="GET" action="dresults.php"
    target="results">
    <table width="100%" border="0" cellspacing="0"
    cellpadding="0">
    <tr>
    <td><div align="center"><img src="block1.gif"
    alt="ball" width="13" height="13" /> <span
    class="style1">Search</span> <img src="block1.gif"
    alt="ball" width="13" height="13" /> </div></td>
    </tr>
    <tr>
    <td> </td>
    </tr>
    <tr>
    <td class="style2"><span class="style2">Drawing
    # : </span></td>
    </tr>
    <tr>
    <td class="style2"><input name="sdn" type="text"
    id="sdn" size="35%" /></td>
    </tr>
    <tr>
    <td><div align="center">
    <input type="submit" name="Submit" value="Submit" />
    </div></td>
    </tr>
    </table>
    </form>
    </body>
    and here is the code from the results page (I only included
    the top half of the code as that is where the query infomation is.
    Let me know if you want to see the remainder):
    <?php require_once('Connections/Birchwood.php'); ?>
    <?php
    $currentPage = $_SERVER["PHP_SELF"];
    $rc=0;
    $maxRows_DrawSearch = 5;
    $pageNum_DrawSearch = 0;
    if (isset($_GET['pageNum_DrawSearch'])) {
    $pageNum_DrawSearch = $_GET['pageNum_DrawSearch'];
    $startRow_DrawSearch = $pageNum_DrawSearch *
    $maxRows_DrawSearch;
    $colname2_DrawSearch = "~";
    if (isset($_GET['ven'])) {
    $colname2_DrawSearch = (get_magic_quotes_gpc()) ?
    $_GET['ven'] : addslashes($_GET['ven']);
    mysql_select_db($database_Birchwood, $Birchwood);
    $query_DrawSearch = sprintf("SELECT bpfno, venno, rev, title,
    location, keywords FROM drawings WHERE vendor LIKE '%%%s%%' ORDER
    BY bpfno ASC", $colname2_DrawSearch);
    $query_limit_DrawSearch = sprintf("%s LIMIT %d, %d",
    $query_DrawSearch, $startRow_DrawSearch, $maxRows_DrawSearch);
    $DrawSearch = mysql_query($query_limit_DrawSearch,
    $Birchwood) or die(mysql_error());
    $row_DrawSearch = mysql_fetch_assoc($DrawSearch);
    if (isset($_GET['totalRows_DrawSearch'])) {
    $totalRows_DrawSearch = $_GET['totalRows_DrawSearch'];
    } else {
    $all_DrawSearch = mysql_query($query_DrawSearch);
    $totalRows_DrawSearch = mysql_num_rows($all_DrawSearch);
    $totalPages_DrawSearch =
    ceil($totalRows_DrawSearch/$maxRows_DrawSearch)-1;
    $queryString_DrawSearch = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
    $params = explode("&", $_SERVER['QUERY_STRING']);
    $newParams = array();
    foreach ($params as $param) {
    if (stristr($param, "pageNum_DrawSearch") == false
    stristr($param, "totalRows_DrawSearch") == false) {
    array_push($newParams, $param);
    if (count($newParams) != 0) {
    $queryString_DrawSearch = "&" .
    htmlentities(implode("&", $newParams));
    $queryString_DrawSearch =
    sprintf("&totalRows_DrawSearch=%d%s", $totalRows_DrawSearch,
    $queryString_DrawSearch);
    ?><!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=iso-8859-1" />
    <title>Untitled Document</title>

  • Please help with recordset

    Hello all,
    I am new to dw. I just update to 8.0.2 but now when i try to
    creat a recordset nothing happen.
    I try to click the bindings and the server Behaviors but
    nothing happen when i click on it.
    Any idea/
    Thanks

    What server model are you using?
    Have you selected that server model in your site definition?
    Have you
    created a successful connection?
    Nancy Gill
    Adobe Community Expert
    Author: Dreamweaver 8 e-book for the DMX Zone
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
    2003)
    Technical Editor: DMX 2004: The Complete Reference, DMX 2004:
    A Beginner''s
    Guide, Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
    Web Development
    "glenny0702" <[email protected]> wrote in
    message
    news:eptl6r$77u$[email protected]..
    > Hello all,
    >
    > I am new to dw. I just update to 8.0.2 but now when i
    try to creat a
    > recordset
    > nothing happen.
    > I try to click the bindings and the server Behaviors but
    nothing happen
    > when i
    > click on it.
    >
    > Any idea/
    >
    > Thanks
    >

  • Help with recordset

    I have a database with 9 items in 1 table
    3 skateboards(records 1 to 3)
    3 bikes (records 4 to 6)
    3 rollerblades (records 7 to 9)
    I want to be able to display records 1 to 3 on one page named
    skate boards
    and records 4 to 6 on another page name bikes
    and the last page showing the 3 types of rollerblades
    can I do this with one table or does I have to create 3 table
    please help
    thanks

    What I would do is add a new field to your table and call it
    Category. Then for your first three records I would add Skateboards
    to the category filed, then Bikes for the next three and
    Rollerblades for the last three.
    What you would normally do then is that you would create two
    pages: a summary page and a detail page. You would list the three
    categories on the summary page and use the Go to Detail Page server
    behaviour to turn them into hyperlinks and pass a query string to
    the detail page. By clicking on the Bikes link for example, you
    would pass the word Bikes in the query string and on the detail
    page you would filter the database to only show those records where
    Category = the query string. In other words, only show those
    records where the Catogory = Bikes.
    But you could also create three static pages and name them as
    you have suggested. All you would do then is on the page called
    skateboards for example, is to filter the database by using an
    entered value - where category = Skateboards. By doing this there
    is no need to pass a query string.
    I think the previous reply didn't quite understand your
    question as there's definitely no need to do a join. This is basic
    database filtering by category as far as I can tell. Hope this
    helps!

  • Recordset structure

    From the help
    Under Recordset Structure, enter the sequence and the number of substructures as follows: <NameA,nA,NameB,nB,...>.
    Where, nA=1,2,3,... or * (for a variable, unlimited number, including 0).
    Can anybody give me examples .......of M/T structure for nA=1, 2 and * (star) ?? Actually I wan to know when to use numbers(nA=1, 2 etc) and when to use ' * ' .
    thanks
    kumar

    Hi,
    In the below structure recordset structure will be:
    SubStrucutreA,2,SubStructureB,1
    indicates that a structure can occur any number of times..It might not occur as well.
    <MessageType>
    <RecordSet>
    <SubStructureA>
    <field1A></field1A>
    </SubStructureA>
    <SubStructureA>
    <field2A></field2A>
    </SubStructureA>
    <SubStructureB>
    <field1B></field1B>
    </SubStructureB>
    </RecordSet>
    </MessageType>
    Regards,
    Sudheer.

  • Xml tag is not supporting in firefox and also recordset keyword not supporting

    In my asp.net application im trying to retrieve values from xml tag and trying to add to one html table with the help of 'recordset'
    Which is working fine in IE but in firefox not working

    A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.
    *http://forums.mozillazine.org/viewforum.php?f=25
    The helpers at that forum are more knowledgeable about web development issues.<br>
    You need to register at the MozillaZine forum site in order to post at that forum.

  • Record set per message

    hi
    if suppose this is my input structure
    <car>
    <color = red/>
    <manufavture = 200/>
    <car/>
    i want to know the entire structure above is 1 recordset per message,please explain the difference between recordset per message and a mesage.

    Hi,
    Copied From SAP Help
    Under Recordsets per Message, specify the number of recordsets to be grouped together in a message. This entry is optional. The default value is *. In the default setting, all recordsets are included in a message.
    If the number of recordsets in a document is greater than the number specified, then the adapter creates multiple messages from a document. The last message might then contain fewer recordsets than specified
    http://help.sap.com/saphelp_nw70/helpdata/EN/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    Regards
    Seshagiri

  • RecordSet  to Cusror Conversion Help Needed

    Hi,
    I have a Perl Code which calls a Stored Procedure in Oracle 8i Database. As you know that you can return Cursors
    and other data types back to Perl and not RecordSets. So I am trying to convert a RecordSet to a Cursor. The Stored
    Procedure Does some complex computations and then stores the results in a record Set. I need to tansfer the data
    from the Record Set back to the Perl Code via a REF Cusror. The only solution that I can think of is Creating a Temp
    Table to store the results and then point a Cursor to that and return that Cusror to the Perl Code. Is there any other
    way of doing this???. I searched lot of sites/forums, But couldnt find any solution.
    You Help will be greatly appreciated :).
    Thanks
    Rajesh

    Hi Rajesh,
    i too had the same requirement but using Java Code.
    One way to return a Cursor to the code is using a package.
    the query which returns the recordset is to be assigned to a ref cursor. For eg.
    CREATE OR REPLACE PACKAGE PKG_PLAN AS
    TYPE RESULT IS REF CURSOR;
    PROCEDURE USERDETAILS2 (
    O_RESULT OUT RESULT
    END PKG_PLAN;
    CREATE OR REPLACE PACKAGE BODY PKG_PLAN AS
    PROCEDURE USERDETAILS2(
                   O_RESULT OUT RESULT
    AS
    BEGIN
    OPEN O_RESULT FOR SELECT DISTINCT US_FIRSTNAME AS UserName,
    US_COMPANYNAME AS Company, TBLUSER.US_PRIMARYEMAIL AS EmailId ,
    FROM
    TBLUSER where
    TBLUSER.US_STATUS = 'A' ORDER BY UserName;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('INSIDE EXCEPTION');
    END USERDETAILS2;
    END PKG_PLAN;
    and in the perl code u will invoke the procedure as
    CALL PKG_PLAN.USERDETAILS2(?)
    where ? is the out parameter -of type cursor which is to be
    registered via perl code.(not sure how it is done in perl)
    and after issuing execute command via perl code
    get the resultset.
    hope u understood it and the above was of help.
    Good luck
    Rani
    Hi,
    I have a Perl Code which calls a Stored Procedure in Oracle 8i Database. As you know that you can return Cursors
    and other data types back to Perl and not RecordSets. So I am trying to convert a RecordSet to a Cursor. The Stored
    Procedure Does some complex computations and then stores the results in a record Set. I need to tansfer the data
    from the Record Set back to the Perl Code via a REF Cusror. The only solution that I can think of is Creating a Temp
    Table to store the results and then point a Cursor to that and return that Cusror to the Perl Code. Is there any other
    way of doing this???. I searched lot of sites/forums, But couldnt find any solution.
    You Help will be greatly appreciated :).
    Thanks
    Rajesh

  • Help with multiple recordsets and pulling an ID value (ASP)

    I started this discussion when first developing my project and posted on the General Tab.  I have figured out that issue (trying to get my Insert to work in ASP) but now am having trouble retrieving an ID value.  It should be simple.  I want to insert a new record into a single table and want to create a unique ID field.  I am using SQL Server and tried the Identity setting but won't be able to have admin privileges which are required to set the ID.  So, I'd like to just take the ID value from the last record and just add '1' to it to get a new unique ID manually. My INSERT portion was working, so I just decided to query the records to retrieve the last CatalogID and add '1' to get my new ID.  But it's not working!  I tried opening both a command and a recordset, but get various errors on invalid command use. 
    Any help would be great!  I'm new to all of this!
    I've posted a code snippet of what I thought I should do:
    <%LANGUAGE = “VBSCRIPT” CODEPAGE=”65001”%)
    <!--#include file=”Connections/CapConnect.asp”” -->
    <%
    If (Cstr(Request(“MM_insert”)) = “form1”) Then
                    Dim MM_editCmd
                    Dim MM_Lookup
                    Dim NextCatalogID
                    Set MM_Lookup = Server.CreateObject (“ADOB.Recordset”)
                    MM_Lookup.ActiveConnection = MM_CapConnect_STRING
                    MM_Liikup.Source = “Select CatalogID From dbo.tblCatalogItems ORDERBY CatalogID Ascending”
                    MMLookup.Open
                    MM_Lookup.MoveLast
                    NextCatalogID = MM_Lookup.Fields(“CatalogID”) + 1   'this is supposed to be my new ID value
                    Set MM_Lookup = Nothing
                    Set MM_editCmd = Server.CreateObject(“ADOB.Command”)
                    MM_editCmd.ActiveConnection = MM_CapConnect_STRING
                    MM_editcmd.CommandText = “INSET INTO dbo.tblCatalogItems (CatalogID, ModelName, Description, POCName, [POCPhone]) VALUES (NextCatalogID, ?,?,?,?)
                    MM_editcmd.Prepared = True
                    MM_edit.Parameters.Append MM_editcmd.CreateParameter(“param2”, 202, 1, 100, Request.Form(“modelname”) )
                  MM_edit.Parameters.Append MM_editcmd.CreateParameter(“param3”, 202, 1, 300, Request.Form(“Description”) )
    [Subject line edited by moderator to add server model]

    Ok, you've got lots of problems. First, explain again why you are not able to modify the CatologID to be an identity column? What is the datatype of that column now?
    Next, you are going about selecting your recordset incorrectly. If you are just looking for the last value inserted, there is no need to return all values to the recordset. Just select the max value:
    MM_Liikup.Source = “Select MAX (CatalogID) From dbo.tblCatalogItems”
    Next, you have a typo in your insert statement "“INSET INTO" should be "INSERT INTO"
    Next, your CommandText is wrong. There is no ending quote, and NextCatalogID will be treated as a string literal, not a variable. Use a ? placeholder for it and use the CreateParameter method to populate it.
    Next, your command text includes 4 placeholder, but you are only populating 2.
    But even when you get this to work it will be problematic. What happens when 2 users execute this at the same time? They both read the same value for the max record and increment by one, but the first will succeed and the second will fail. That's why it is always better to use an auto increment (Identity) column.

  • Help with Test Server & Binding Recordset ASP-SQL

    Using CS 3.3/DW. Behavior is the same on two different
    machines. One is Vista Home Premium SP1 IIS 7 with 6 compatability,
    other is XP SP 3 IIS 5.1, both have IE 7 and full SQL 2005 with
    SP's.
    Haven't gotten very far away from static page yet, because I
    can't test. Have scoured forums and even talked to Adobe who
    recreated the problem then told me that they hadn't done sufficient
    testing to SQL 2005 prior to release, were supposed to call me
    back, did once, supposed to call back again and haven't (3 days).
    So I'm turning to the community for help, please.
    Set up test server in folder 'TServer' under
    C:\inetpub\wwwroot. Built a 'Hello World' ASP/VB Script page with
    no data attached, tests fine, puts in the appropriate folder and
    says "Hello World" in browser like a good little box should! Have
    built many DSN's, they tested during the building fine, I've tried
    various versions of ODBC and OLE DB, including but not limited to
    Native SQL Client, which is my preference and have been quite
    successful setting up the DSN's...they add to the ASP page/Site
    (it's greyed out unless you have an open ASP page) fine. Test at
    that point works fine. As soon as I bind a Recordset (whether I
    have dropped data on the page or not...same 'Hello World' page with
    Recordset info near the top of the code) and test, I error out.
    Any thoughts? I'm sure you'll need more info...I've tried to
    put as much as I can for starters. Thanks in advance.
    Peter

    When you say that you error out, what error are you getting?
    Ken Ford
    Adobe Community Expert - Dreamweaver/ColdFusion
    Fordwebs, LLC
    http://www.fordwebs.com
    "Peter AZ" <[email protected]> wrote in
    message news:g5qb7n$n30$[email protected]..
    > Using CS 3.3/DW. Behavior is the same on two different
    machines. One is Vista
    > Home Premium SP1 IIS 7 with 6 compatability, other is XP
    SP 3 IIS 5.1, both
    > have IE 7 and full SQL 2005 with SP's.
    >
    > Haven't gotten very far away from static page yet,
    because I can't test. Have
    > scoured forums and even talked to Adobe who recreated
    the problem then told me
    > that they hadn't done sufficient testing to SQL 2005
    prior to release, were
    > supposed to call me back, did once, supposed to call
    back again and haven't (3
    > days). So I'm turning to the community for help, please.
    >
    > Set up test server in folder 'TServer' under
    C:\inetpub\wwwroot. Built a
    > 'Hello World' ASP/VB Script page with no data attached,
    tests fine, puts in the
    > appropriate folder and says "Hello World" in browser
    like a good little box
    > should! Have built many DSN's, they tested during the
    building fine, I've tried
    > various versions of ODBC and OLE DB, including but not
    limited to Native SQL
    > Client, which is my preference and have been quite
    successful setting up the
    > DSN's...they add to the ASP page/Site (it's greyed out
    unless you have an open
    > ASP page) fine. Test at that point works fine. As soon
    as I bind a Recordset
    > (whether I have dropped data on the page or not...same
    'Hello World' page with
    > Recordset info near the top of the code) and test, I
    error out.
    >
    > Any thoughts? I'm sure you'll need more info...I've
    tried to put as much as I
    > can for starters. Thanks in advance.
    >
    > Peter
    >
    >

  • Help I can't get my images and description from recordset to display in repeat region table

    Hi everyone,
    could somebody please help me, this is my first php and mysql website, I have a web page that is supposed to display a table with 2 rows 3 columns.
    In each column i want an image, a description and a paypal button.
    then i have a repeat region placed around the second row which should display 3 records at a time.
    The recordset worked when I tested it several times, and the paypal button displays in the browser, but the image and the description won't display and the repeat region doesn't work either as only one button paypal button displays.
    I have uploaded the actual page, in the hope that some could take a look and help me to find out what the problem is.
    Thanks

    In the second row, did you mean you want the three fields to display, not three records?  A record is one row of data.
    Start by getting a single row to display, and leave the paypal button out for now.  So that means you will see the first record in your recordset, the image and description.  To view the description, use the data bindings panel, expand the recordset and drag the description field onto the page in the table.  For the image, insert and image placeholder and point the source to a dynamic data source. Again, choose the approprate field from your recordset.
    Once that record is working, add your repeat region and test.
    For the Paypal button, I am not sure if each button will carry the correct information with it in a repeat region.  There has to be a way to dynamicall add the approprate data to the paypal link for each record.  You may want to also incude checkboxes or radio buttons and have only 1 paypal button - but that introduces other issues which we can tackle later.

  • Need help with a recordset

    I need some help with a recordset that selects a series of
    vehicle makes that then show models when a make is selected. The
    problem is when I select the make it shows a list of models like it
    should, some of the make lists have five models and some have ten
    or more. What I need help with is how to limit the list to just the
    models and not include the "null" values. This makes my drop down
    list have large empty spaces at the end of the options listed. The
    query is as follows:
    SELECT *
    FROM saa.vehicle_make
    WHERE make = '#FORM.select_make#'
    Question # 2:
    What can I add to this recordset so that I can search on just
    the make alone without the model included. The submit includes both
    of the make and model lists so that makes it tough to break up.
    Here is the recordset:
    SELECT make
    FROM saa.vehicle_make
    ORDER BY make ASC
    Thanks
    Shane

    Sorry I guess I wasn't being clear. The lists work fine with
    the present recordsets but I was trying to clean them up just a
    little. I am using a table in mysql instead of an array for ease of
    maintenance due to the high number of makes and models I am working
    with.
    For question number one I was looking for sql that allows me
    to only show the models in the table for each make no matter how
    many are in the row. Currently when I use the existing recordset I
    get a long list of blank spaces as it is returning the "null"
    fields also. I would like it to just show the models and stop at
    the first null field.
    For the second question I wanted to be able to submit the
    form with just the make listed if someone wanted to see all Hondas
    lets say. Not I have to select the make also so it limits the
    return.
    Thanks for all of the input
    Shane
    Here is the code I am using for the two dependent select
    boxes:
    <p align="center">Vehicle Search by
    Make/Model</p>
    <!--- store the selected make variable after the first
    select boxes submits itself --->
    <cfif isDefined('form.select_make')>
    <cfset page.select_make = form.select_make>
    </cfif>
    <cfoutput>
    <form name="DropDown" method="post">
    <!--- query DB for the first drop down list --->
    <cfquery name="get_make" datasource="saa">
    SELECT make FROM saa.vehicle_make ORDER BY make ASC
    </cfquery>
    <!--- first drop down list --->
    <!--- NOTICE the onChange javascript event in the select
    tag, this is what submits the form after the first selection
    --->
    <p align="center">Model:<select name="select_make"
    required="yes" onchange="this.form.submit()">
    <option>Select Make</option>
    <!--- dynamically populate the first drop down list based
    on the get_make query --->
    <cfloop query="get_make">
    <option value="#make#" <cfif
    isDefined('form.select_make')><cfif form.select_make eq
    "#make#">selected</cfif></cfif>>#make#</option>
    </cfloop>
    </select></p>
    <!--- if the first selection has been made, display the
    second drop down list with the appropriate results --->
    <cfif isDefined('form.select_make')>
    <!--- query DB for second drop down list, based on the
    selected item from the first list --->
    <cfquery name="get_model" datasource="saa">
    SELECT * FROM saa.vehicle_make WHERE make =
    '#FORM.select_make#'
    </cfquery>
    <!--- second drop down list --->
    </cfif>
    </form>
    </cfoutput>
    <cfoutput>
    <form action="buyerModelSearchresults.cfm"
    method="POST">
    <p align="center">Model: <select name="model"
    required="yes">
    <option>Select Model</option>
    <!--- dynamically populate the second drop down list
    based on the get_make query --->
    <cfloop query="get_model">
    <option value="#model1#">#model1#</option>
    <option value="#model2#">#model2#</option>
    <option value="#model3#">#model3#</option>
    <option value="#model4#">#model4#</option>
    <option value="#model5#">#model5#</option>
    <option value="#model6#">#model6#</option>
    <option value="#model7#">#model7#</option>
    <option value="#model8#">#model8#</option>
    <option value="#model9#">#model9#</option>
    <option value="#model10#">#model10#</option>
    <option value="#model11#">#model11#</option>
    <option value="#model12#">#model12#</option>
    <option value="#model13#">#model13#</option>
    <option value="#model14#">#model14#</option>
    <option value="#model15#">#model15#</option>
    <option value="#model16#">#model16#</option>
    <option value="#model17#">#model17#</option>
    <option value="#model18#">#model18#</option>
    <option value="#model19#">#model19#</option>
    <option value="#model20#">#model20#</option>
    <option value="#model21#">#model21#</option>
    <option value="#model22#">#model22#</option>
    <option value="#model23#">#model23#</option>
    <option value="#model24#">#model24#</option>
    <option value="#model25#">#model25#</option>
    </cfloop>
    </select>
    </p>
    <p align="center">Search by Make/Model:</p>
    <p align="center"><input type="submit" name="Submit"
    value="Submit"></p>
    </form>
    </cfoutput>

  • HELP!!! Recordset on Oracle 9i

    I installed an Oracle 9i Client in a Web Server running under
    Windows 2000. Suddenly all my applications stopped working.
    I was able to locate the error. It occurs every time I use a
    Static Recordset. Here is a bit of code:
    set con = server.createobject("ADODB.Connection")
    con.open "user","pw","odbcConnection"
    set rs = server.createobject("ADODB.Recordset")
    rs.Open "select p.id, p.c1, f.c2"&_
              " from p, f "&_
              " where p.id = f.id", con, 3, 3
    while not rs.eof
    response.write(rs.fields("id")&"<BR>")
    rs.movenext
    wend
    The error:
    Error Type:
    ADODB.Recordset (0x800A0CC1)
    Item cannot be found in the collection corresponding to the
    requested name or ordinal.
    If I change to " where p.id = f.id", con, 2, 3
    which is a dynamic cursor it works ok.
    If I use the con.Execute command, it also works ok.
    The applications worked fine with Oracle 8i client...
    Please HELP!
    Thanks in advance.

    I installed an Oracle 9i Client in a Web Server running under
    Windows 2000. Suddenly all my applications stopped working.
    I was able to locate the error. It occurs every time I use a
    Static Recordset. Here is a bit of code:
    set con = server.createobject("ADODB.Connection")
    con.open "user","pw","odbcConnection"
    set rs = server.createobject("ADODB.Recordset")
    rs.Open "select p.id, p.c1, f.c2"&_
              " from p, f "&_
              " where p.id = f.id", con, 3, 3
    while not rs.eof
    response.write(rs.fields("id")&"<BR>")
    rs.movenext
    wend
    The error:
    Error Type:
    ADODB.Recordset (0x800A0CC1)
    Item cannot be found in the collection corresponding to the
    requested name or ordinal.
    If I change to " where p.id = f.id", con, 2, 3
    which is a dynamic cursor it works ok.
    If I use the con.Execute command, it also works ok.
    The applications worked fine with Oracle 8i client...
    Please HELP!
    Thanks in advance.

  • How do i filter recordsets using session variable???  Please help this is driving me mad...!!

    I am having the same problem as user "Gabe the animator" in a post sent in 2007.
    "my recordset that drives a dynamic table won't filter results based on a session variable. I know session variables are working because I have the session variable echo on the page (dragged-n-dropped my session variable from the Bindings panel to my page), and that works fine. So why can't I filter my recordset with the same session variable???"
    here is the code:
    <?php require_once('Connections/mockconn.php'); ?>
    <?php
    session_start();
    ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $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;
    if(!session_id()){
    session_start();
    $colname_info = "-1";
    if (isset($_SESSION['email'])) {
      $colname_info = $_SESSION['email'];
    mysql_select_db($database_mockconn, $mockconn);
    $query_info = sprintf("SELECT name, last_name, email, password FROM registration WHERE email = %s", GetSQLValueString($colname_info, "text"));
    $info = mysql_query($query_info, $mockconn) or die(mysql_error());
    $row_info = mysql_fetch_assoc($info);
    $totalRows_info = mysql_num_rows($info);
    ?>
    <!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>home</title>
    </head>
    <body>
    <div id="info">hello <?php echo $row_info['']; ?></div>
    <?php
    if (isset($_SESSION['email'])) {
              echo 'your email: '.' '. $_SESSION['email'] .' '.'good job';}
                        ?>
    </body>
    </html>
    PLEASE PLEASE HELP.... I have been at this for day's...
    how do I get the record set to filter based on the value of the session variable

    Sorry I forgot to mension the error I am getting?
    ( ! ) Notice: Undefined index: in C:\wamp\www\mock\home.php on line 59
    Call Stack
    Time
    Memory
    Function
    Location
    1
    0.0093
    389024
    {main}( )
    ..\home.php:0
    Why is this error coming up?

Maybe you are looking for

  • Error while saving query in Bex

    Hi, We are currently on Nw2004s - Support pack 9 and front end gui version is 640 patch 21. When trying to create a new query or saving the existing one we are getting following error... Program GP0P874U0694ORXYVN4FP6IZC5F does not exist 0 An excepti

  • Problem scrolling up n down in touchpad

    i've installed Win7 and i don't know how to bring back the scrolling option in my touchpad, i know its got something to do with the Device Manager, cuz i found a solution once and i forgot it. please help, thanks

  • Edit/delete/insert forms using php

    Hi, I have created an application that will allow me to edit/delete/insert data to my database using php. The functions work. But when I click on a tab i get an error like this: ypeError: Error #1009: Cannot access a property or method of a null obje

  • IPod refuses to sync on iTunes 9.0.1

    Every time I try syncing my music, the process will hang a quarter of the way. When it hangs, I'm unable to cancel the sync process. This forces me to quit iTunes, which often results in an inability to relaunch iTunes unless I restart the computer.

  • Problem  connection iPad to net gear wn2000rpt

    All appears to be connected, lights are all green but does connect to Internet