Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    South Korea
    Posts
    5

    Red face Unanswered: please help me!!!! ASP GOT MAT AT ME

    WINDOWS 2000 / SQL SERVER 2000/ DATA ACCESS(MDAC_TYPE 2.8) / ODBC, ADO

    hello
    i dont know that i got in the right place, but want to get a little tip with the
    following situation.


    ==== ORIGNINAL SOURCE CODE ====

    <%

    Call BoardOpen()

    RedSql = " SELECT " _
    & " T.MGM_NO AS MGM_NO, " _
    & " T.POP_TITLE AS POP_TITLE, " _
    & " T.POP_CONTENT AS POP_CONTENT, " _
    & " T.TARGET_URL AS TARGET_URL, " _
    & " ISNULL(S.IMG_LOC,'BLANK.JPG') AS IMG_LOC, " _
    & " S.IMG_SIZE AS IMG_SIZE " _
    & " FROM DILMUN_POPUP T, DILMUN_POPBACK S "_
    & " WHERE T.IMG_NO = S.MGM_NO AND T.MGM_NO='" & REQUEST("MGM_NO") & "'"

    Set RedRs = createobject("adodb.recordset")
    RedRs.Open RedSql, BoardCon

    PopupContent = replace(RedRs("POP_CONTENT"),chr(13),"<br>")
    PopupContent = replace(PopupContent," ","&nbsp;")
    ManagementNo = RedRs("MGM_NO")
    ImageLocation = RedRs("IMG_LOC")
    PopupTitle = RedRs("POP_TITLE")
    Target_url = RedRs("TARGET_URL")
    ImageSize = RedRs("IMG_SIZE")

    Call BoardClose()

    Response.Write(ImageLocation)

    %>

    ==== PROBLEMS' HERE ====

    ALLL OF THE COLUMNS HAVE THEIR VALUES AND NOT NULL.

    I GET UNEXPECTED RESULT VALUE FOR THE SPECIFIED COLUMN(eg, ImageLocation) WHEN I RUN ABOVE CODE FROM IIS.

    Variable 'ImageLocation' is a value containing directory information like '/home/image/background/sample.gif')

    The value 'ImageLocation' is displayed as 'NULL' even though that has value.
    but All other values for columns are displayed perfectly normal

    HAS ANYBODY SEEN THIS CASE?

    i would be really appreciate if you have any comment, waiting for your reply ---

    Ps) sometimes, variable 'PopupTitle' and 'Target_url' have the same symptoms.

    ==== MY CONTACT INFO ====
    email : upward011@nate.com, 101103256(ICQ), pchanjo(yahoo), upupward@sayclub.com(msn)

  2. #2
    Join Date
    Sep 2003
    Posts
    60

    Re: please help me!!!! ASP GOT MAT AT ME

    If you put a Response.write RedSql in there follwed by a Response.end you'll capture the *exact* sql which you can cut & paste into Query Analyzer and run it. If you see columns resulting in NULL then the SQL needs fixing. Or you may want to modify your variable assignmments by appending a NULL string at the end. This prevents NULL errors...
    Code:
    ImageLocation = RedRs("IMG_LOC") & ""
    ...but I don't see how that column could return NULL given the sql.

  3. #3
    Join Date
    Oct 2003
    Location
    Iran/Tehran
    Posts
    4

    Thumbs up u should use trim function

    hi ,

    u should use trim() function to prepare u're values which came from u're database.

    for example u should use Response.Write(trim(ImageLocation)) instead of Response.Write(ImageLocation).

Posting Permissions

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