If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > please help me!!!! ASP GOT MAT AT ME

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-29-03, 21:17
upward upward is offline
Registered User
 
Join Date: Sep 2003
Location: South Korea
Posts: 5
Red face 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)
Reply With Quote
  #2 (permalink)  
Old 10-01-03, 20:12
bill_dev bill_dev is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 10-24-03, 22:46
shahab shahab is offline
Registered User
 
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).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On