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

  1. #1

    Default Code problem

    Does anyone know what the problem with this code is:

    <% If NOT(rs_shiurim("Daily") = "") Then %>
    <tr>
    <td width="13%"><strong>DAILY</strong></td>
    <td width="87%"><%=rs_shiurim("Daily")%></td>
    </tr>

    It only prints "DAILY" when the string is NOT ""

    Thanks
    Shimon

    Shimon Guest

  2. Similar Questions and Discussions

    1. Problem with JScript code
      My homepage has 3 layers. Two layers have this sample script. The script is supposed to force open Explorer flash able to render the flash file....
    2. Code Problem (again)
      Here we go again. I am trying to populate an array of objects and assign it to a data slot in application.onAppStart. This is my code: //-----...
    3. Problem with asp code
      i don't have any idea of how to get the content or information of other web site using asp code. if you guys have any solution please share with me ...
    4. Problem with a code
      Hello, I have this code: <?php $fpload = fopen(''.$ziel.'', 'r'); $fpsave = fopen(''.$endname.'', 'w'); if ($fpload && $fpsave) { while...
    5. Security problem with Managed Code calling Unmanaged Code in a Web Page
      Hello, I have a web page which contains an ActiveX control (unmanaged) and a Windows Forms User Control (managed). Both reside on a web page and...
  3. #2

    Default Re: Code problem

    That's what it's supposed to do. You have NOT = "". Look at it like this.

    <%
    sValue = rs_shiurim.FIELDS.ITEM("Daily").VALUE
    bIsEmpty = sValue = ""

    If Not bIsEmpty Then %>
    <tr....

    <% End If %>


    So, if sValue is "", then bEmpty is true, right? If it's empty, it is NOT
    "" and bEmpty is false. So,

    If not FALSE Then
    'NOT FALSE = TRUE, SO CODE WILL EXECUTE

    Ray at work

    "Shimon" <shimon@iafrica.com> wrote in message
    news:0b2f01c3af43$50c89c60$a301280a@phx.gbl...
    > Does anyone know what the problem with this code is:
    >
    > <% If NOT(rs_shiurim("Daily") = "") Then %>
    > <tr>
    > <td width="13%"><strong>DAILY</strong></td>
    > <td width="87%"><%=rs_shiurim("Daily")%></td>
    > </tr>
    >
    > It only prints "DAILY" when the string is NOT ""
    >
    > Thanks
    > Shimon
    >

    Ray at Guest

  4. #3

    Default Re: Code problem

    On Thu, 20 Nov 2003 00:50:14 -0800, "Shimon" <shimon@iafrica.com>
    wrote:
    >Does anyone know what the problem with this code is:
    >
    > <% If NOT(rs_shiurim("Daily") = "") Then %>
    > <tr>
    > <td width="13%"><strong>DAILY</strong></td>
    > <td width="87%"><%=rs_shiurim("Daily")%></td>
    > </tr>
    >
    >It only prints "DAILY" when the string is NOT ""
    Do a Response.Write on the string to see what actually *is* there.

    Jeff
    Jeff Cochran Guest

  5. #4

    Default Re: Code problem

    You have a misplaced parenthesis; try:

    <% If NOT(rs_shiurim("Daily")) = "" Then %>


    "Shimon" <shimon@iafrica.com> wrote in message
    news:0b2f01c3af43$50c89c60$a301280a@phx.gbl...
    > Does anyone know what the problem with this code is:
    >
    > <% If NOT(rs_shiurim("Daily") = "") Then %>
    > <tr>
    > <td width="13%"><strong>DAILY</strong></td>
    > <td width="87%"><%=rs_shiurim("Daily")%></td>
    > </tr>
    >
    > It only prints "DAILY" when the string is NOT ""
    >
    > Thanks
    > Shimon

    McKirahan Guest

  6. #5

    Default Code Problem

    I can't figure out why this code segment will not print
    line 4 if the condition is true.

    1 <%If NOT IsNull(rs_shiurim("Tuesday")) Then %>
    2 <tr>
    3 <td width="13%"><strong>Tuesday</strong></td>
    4 <td width="87%"><%=rs_shiurim("Tuesday")%></td>
    5 </tr>
    6 <% End If %>

    Line 2, 3 and 5 are printed. rs_shiurim is a recordset
    generated from a SQL quesy to an Access DB.
    Thanks
    Shimon
    Shimon Guest

  7. #6

    Default Re: Code Problem

    Perhaps rs_shiurim("Tuesday") is not null, but it is empty.

    I've never had much faith in isNull and prefer to use....

    if len(rs_shiurim("Tuesday") & "")=0 then
    'rs_shiurim("Tuesday")is either null or empty
    else
    'rs_shiurim("Tuesday") contains something
    end if

    "Shimon" <shimon@iafrica.com> wrote in message
    news:087901c3b4e3$b7972e20$a501280a@phx.gbl...
    > I can't figure out why this code segment will not print
    > line 4 if the condition is true.
    >
    > 1 <%If NOT IsNull(rs_shiurim("Tuesday")) Then %>
    > 2 <tr>
    > 3 <td width="13%"><strong>Tuesday</strong></td>
    > 4 <td width="87%"><%=rs_shiurim("Tuesday")%></td>
    > 5 </tr>
    > 6 <% End If %>
    >
    > Line 2, 3 and 5 are printed. rs_shiurim is a recordset
    > generated from a SQL quesy to an Access DB.
    > Thanks
    > Shimon

    TomB Guest

  8. #7

    Default Re: Code Problem

    "Shimon" <shimon@iafrica.com> wrote in message
    news:087901c3b4e3$b7972e20$a501280a@phx.gbl...
    > I can't figure out why this code segment will not print
    > line 4 if the condition is true.
    >
    > 1 <%If NOT IsNull(rs_shiurim("Tuesday")) Then %>
    > 2 <tr>
    > 3 <td width="13%"><strong>Tuesday</strong></td>
    > 4 <td width="87%"><%=rs_shiurim("Tuesday")%></td>
    > 5 </tr>
    > 6 <% End If %>
    It can't print without "Response.write", and you have to change the
    way the rs_shiurim is concatenated to go along with that. Like this:

    Response.Write "<td width="87%">" & rs_shiurim("Tuesday") & "</td>"

    I would also change the double quotes around the HTML values the
    single quotes so they don't interferre with the double quotes used
    with Response.Write. You could even put rs_shiurim on a line by
    itself if that helps readability,...in the end it will all be on one
    line in the resulting HTML.

    <%If NOT IsNull(rs_shiurim("Tuesday")) Then %>
    Response.write "<tr>"
    Response.write "<td width='13%'><strong>Tuesday</strong></td>"
    Response.write "<td width='87%'>"
    Response.write rs_shiurim("Tuesday")
    Response.write "</td></tr>"
    <% End If %>

    --

    Phillip Windell [CCNA, MVP, MCP]
    WAND-TV (ABC Affiliate)
    [url]www.wandtv.com[/url]


    Phillip Windell Guest

  9. #8

    Default Re: Code Problem

    <td width="87%"><%=rs_shiurim("Tuesday")%></td>

    the <%= is the same as Response.write so that part is fine.

    "Phillip Windell" <none> wrote in message
    news:OKKi11EuDHA.2132@TK2MSFTNGP10.phx.gbl...
    > "Shimon" <shimon@iafrica.com> wrote in message
    > news:087901c3b4e3$b7972e20$a501280a@phx.gbl...
    > > I can't figure out why this code segment will not print
    > > line 4 if the condition is true.
    > >
    > > 1 <%If NOT IsNull(rs_shiurim("Tuesday")) Then %>
    > > 2 <tr>
    > > 3 <td width="13%"><strong>Tuesday</strong></td>
    > > 4 <td width="87%"><%=rs_shiurim("Tuesday")%></td>
    > > 5 </tr>
    > > 6 <% End If %>
    >
    > It can't print without "Response.write", and you have to change the
    > way the rs_shiurim is concatenated to go along with that. Like this:
    >
    > Response.Write "<td width="87%">" & rs_shiurim("Tuesday") & "</td>"
    >
    > I would also change the double quotes around the HTML values the
    > single quotes so they don't interferre with the double quotes used
    > with Response.Write. You could even put rs_shiurim on a line by
    > itself if that helps readability,...in the end it will all be on one
    > line in the resulting HTML.
    >
    > <%If NOT IsNull(rs_shiurim("Tuesday")) Then %>
    > Response.write "<tr>"
    > Response.write "<td width='13%'><strong>Tuesday</strong></td>"
    > Response.write "<td width='87%'>"
    > Response.write rs_shiurim("Tuesday")
    > Response.write "</td></tr>"
    > <% End If %>
    >
    > --
    >
    > Phillip Windell [CCNA, MVP, MCP]
    > WAND-TV (ABC Affiliate)
    > [url]www.wandtv.com[/url]
    >
    >

    TomB Guest

  10. #9

    Default Re: Code Problem

    "TomB" <shuckle@hotmail.com> wrote in message
    news:uagWGCFuDHA.2208@TK2MSFTNGP10.phx.gbl...
    > <td width="87%"><%=rs_shiurim("Tuesday")%></td>
    >
    > the <%= is the same as Response.write so that part is fine.
    Yes. I was thinking that the whole thing was inside the <%....%>
    instead of outside of the tags as raw html with simply the <%=.....%>
    inserted where needed.

    --

    Phillip Windell [CCNA, MVP, MCP]
    WAND-TV (ABC Affiliate)
    [url]www.wandtv.com[/url]


    Phillip Windell Guest

  11. #10

    Default Re: Code Problem

    Seems the only to code to work is as follows:
    Dim sData
    sData = CStr(rs_shiurim("Tuesday"))
    If sData <> "" Then
    Response.Write("<tr><td><strong>" & header)
    Reponse.Write("</strong></td><td>" & sData)
    Response.Write("</td></tr>")
    End If

    Thanks
    Shimon



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

  12. #11

    Default Re: Code Problem

    does the data column happen to be of long varchar (memo) type?
    if so this is an old fairly well-documented problem and the work-around is
    to use a local variable as you have.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    "Simeon Shapiro" <shimon@iafrica.com> wrote in message
    news:OHDQEmduDHA.2440@TK2MSFTNGP12.phx.gbl...
    > Seems the only to code to work is as follows:
    > Dim sData
    > sData = CStr(rs_shiurim("Tuesday"))
    > If sData <> "" Then
    > Response.Write("<tr><td><strong>" & header)
    > Reponse.Write("</strong></td><td>" & sData)
    > Response.Write("</td></tr>")
    > End If
    >
    > Thanks
    > Shimon
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Mark Schupp Guest

  13. #12

    Default Re: Code Problem

    Yes. It's a memo type variable.
    Where would one find such documented problems?

    Thanks
    Shimon



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

  14. #13

    Default Re: Code Problem

    Simeon Shapiro wrote:
    > Yes. It's a memo type variable.
    > Where would one find such documented problems?
    >
    [url]www.aspfaq.com[/url]

    Bob


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows 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