ASP Dynamic List Check If Exist

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default ASP Dynamic List Check If Exist

    Hello,

    Here's a good one for you guys. I appreciate any help you can provide.

    ClinShipPartNumber.asp

    Currently I have this page which displays a listing of part numbers in
    my database. I'm looping through the recordset and counting at the same
    time and assigning the unique number to the name of the checkbox so I
    can add and update within my database. All this is working great.

    sSQL = SELECT * FROM tblItemMaster

    <%
    iCount = 0
    Do While NOT rsPartListing.EOF
    %>
    <input type="checkbox" name="ckPartNumber<%=iCount%>"
    value="<%=rsPartListing("PartNumber")%>">
    <%=rsPartListing("PartNumber")%>
    <%=rsPartListing("Description")%>
    <%
    iCount = iCount + 1
    rsPartListing.MoveNext
    %>

    What I want to do is check and see if that particular part number is
    entered into another table. If so I want to automatically check that
    box, while still displaying the other possible part numbers. I'm having
    difficulty comparing the two values, while still looping through both
    tables.

    Any thoughts ?

    Thanks,
    Chad

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Chad S Guest

  2. Similar Questions and Discussions

    1. Newbie, how to check if a value in a gridview cell already exist in database
      Hi I've the following dataset bound to my gridview <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$...
    2. Check if username exist alternative..? please help
      Hi - using ASP/Access/Vbscript Want to use a alternative of the DW check if username exist behaviour. I have a insert record form on my page....
    3. Fonts in list that do not exist FHMXa-Panther
      Actually 2 things: We have some FH10 docs we are opening in MXa. The document has a font reference to B Futura. There is no B Futura on the...
    4. truly dynamic check boxes
      I am using FMP 6. Is there a way to mimic check boxes functionality so that the checked information can be easily edited rather have the rigid...
    5. SCO OpenServer 5.0.x -- Exist a command who check a which files are modified, update or change into a directory ?
      SCO OpenServer 5.0.x -- Exist a command who check a which files are modified, update or change into a directory ? Thanks in advance. Francisco
  3. #2

    Default Re: ASP Dynamic List Check If Exist

    "Chad S" <webaccess@hotmail.com> wrote in message
    news:%23C7llI0QEHA.904@TK2MSFTNGP12.phx.gbl...
    > Hello,
    >
    > Here's a good one for you guys. I appreciate any help you can provide.
    >
    > ClinShipPartNumber.asp
    >
    > Currently I have this page which displays a listing of part numbers in
    > my database. I'm looping through the recordset and counting at the same
    > time and assigning the unique number to the name of the checkbox so I
    > can add and update within my database. All this is working great.
    >
    > sSQL = SELECT * FROM tblItemMaster
    >
    > <%
    > iCount = 0
    > Do While NOT rsPartListing.EOF
    > %>
    > <input type="checkbox" name="ckPartNumber<%=iCount%>"
    > value="<%=rsPartListing("PartNumber")%>">
    > <%=rsPartListing("PartNumber")%>
    > <%=rsPartListing("Description")%>
    > <%
    > iCount = iCount + 1
    > rsPartListing.MoveNext
    > %>
    >
    > What I want to do is check and see if that particular part number is
    > entered into another table. If so I want to automatically check that
    > box, while still displaying the other possible part numbers. I'm having
    > difficulty comparing the two values, while still looping through both
    > tables.
    >
    > Any thoughts ?
    >
    > Thanks,
    > Chad
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!
    Left join the tblItemMaster table to the "other" table and include an
    expression in the column list of the select statement that indicates whether
    the part number in the other table is null. Then when you iterate through
    the recordset, output a "checked" attribute in the input tag if the
    is_other_table_part_number_null field is false. You may also want to
    consider using the GetRows method of the Recordset object and iterate
    through the resulting array instead of iterating through the recordset.
    Also, you should avoid using "SELECT *". You may even want to use some type
    of stored procedure/parameterized query. Finally, when posting a database
    related question, please include which database and version you are using
    along with data definition language, sample data and desired output/results.
    Here are some articles:

    [url]http://aspfaq.com/show.asp?id=2467[/url]
    [url]http://aspfaq.com/show.asp?id=2096[/url]
    [url]http://aspfaq.com/show.asp?id=2201[/url]
    [url]http://aspfaq.com/etiquette.asp?id=5006[/url]

    HTH
    -Chris Hohmann




    Chris Hohmann Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139