#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    17
    Rep Power
    0

    Record did not come up


    Hi,

    Please, can anyone give me idea why my code was not work for the last record.

    All other record come out correctly but for "Artistic_Field_Others" was not come up.

    Database name is correct as well.

    Thanks in advanced.
    Here is my code:

    <%
    Dim strArtFields
    strArtFields = ""

    If Len(rs("Artistic_Field_Literary_Arts")) >0 Then strArtFields = strArtFields & "," & rs("Artistic_Field_Literary_Arts")
    If Len(rs("Artistic_Field_Dance")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Dance")
    If Len(rs("Artistic_Field_Music")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Music")
    If Len(rs("Artistic_Field_Theatre")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Theatre")
    If Len(rs("Artistic_Field_Visual_Arts")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Visual_Arts")
    If Len(rs("Artistic_Field_Others")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Others") ////This fields was not come up anything ////

    If Left(strArtFields, 1) = "," Then strArtFields = Right(strArtFields, Len(strArtFields) -1)

    response.write rs("Artistic_Field_Film") & strArtFields
    %>
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    17
    Rep Power
    0

    show up FilmDance,Music instead of Film,Dance,Music


    Hi,

    It solved already but it show up like below:

    FilmDance,Theatre instead of Film,Dance,Theatre.

    Please, can anyone help me out to get Film,Literary Arts,Dance instead of FilmLiteraryArts,Dance.

    How to fix to get right format.

    Here is my code:

    <%
    Dim strArtFields
    strArtFields = ""
    If Len(rs("Artistic_Field_Literary_Arts")) >0 Then strArtFields = strArtFields & "," & rs("Artistic_Field_Literary_Arts")
    If Len(rs("Artistic_Field_Dance")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Dance")
    If Len(rs("Artistic_Field_Music")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Music")
    If Len(rs("Artistic_Field_Theatre")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Theatre")
    If Len(rs("Artistic_Field_Visual_Arts")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Visual_Arts")
    If Len(rs("Artistic_Field_Others")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Others")

    If Left(strArtFields, 1) = "," Then strArtFields = Right(strArtFields, Len(strArtFields) -1)

    response.write rs("Artistic_Field_Film") & strArtFields
    %>

    Thanks in advanced.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    120
    Rep Power
    10
    Code:
    <% 
    Dim strArtFields
     strArtFields = ""
     If Len(rs("Artistic_Field_Literary_Arts")) >0 Then strArtFields = strArtFields & "," & rs("Artistic_Field_Literary_Arts")
     If Len(rs("Artistic_Field_Dance")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Dance")
     If Len(rs("Artistic_Field_Music")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Music")
     If Len(rs("Artistic_Field_Theatre")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Theatre")
     If Len(rs("Artistic_Field_Visual_Arts")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Visual_Arts")
     If Len(rs("Artistic_Field_Others")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Others") 
    
    If Left(strArtFields, 1) = "," Then strArtFields = Right(strArtFields, Len(strArtFields) -1)
    
    if trim(rs("Artistic_Field_Film")  & " ")<>"" then
     response.write rs("Artistic_Field_Film") & ", " & strArtFields
    else
     response.write strArtFields
    end if
    
     %>
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    17
    Rep Power
    0
    Hi,

    Thanks for giving me idea.

    Actually i found the right one as followed:

    <%
    Dim strArtFields
    strArtFields = ""
    If Len(rs("Artistic_Field_Literary_Film")) >0 Then strArtFields = strArtFields & "," & rs("Artistic_Field_Film")
    If Len(rs("Artistic_Field_Literary_Arts")) >0 Then strArtFields = strArtFields & "," & rs("Artistic_Field_Literary_Arts")
    If Len(rs("Artistic_Field_Dance")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Dance")
    If Len(rs("Artistic_Field_Music")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Music")
    If Len(rs("Artistic_Field_Theatre")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Theatre")
    If Len(rs("Artistic_Field_Visual_Arts")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Visual_Arts")
    If Len(rs("Artistic_Field_Others")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Others")

    If Left(strArtFields, 1) = "," Then strArtFields = Right(strArtFields, Len(strArtFields) -1)

    response.write strArtFields
    %>

IMN logo majestic logo threadwatch logo seochat tools logo