Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

special charater found

Status
Not open for further replies.

maesb

Technical User
Mar 25, 2003
30
JP
Hi,

I found a special character in my database table which gives my asp page an error when loading. It's a black colour box at the end of my string.
I'm not sure how the user key in the character, but my guess is that it's a carriage return. So, i try to get rid of it by doing this :

<code>
FARM=Replace(Trim(objRS("farm")),chr(13)," ")
</code>

It doesn't help.
This html line still gives me an "Unterminated String Constraint" error :

<code>
document.form1.farm.value = 'CRT ( A68LZU185 ),

';
</code>

Please help. Thanks.
 
http.encode the variable and display it with a response.write and you will see what it is. Then you can trap it and prevent it from happening again.
 
travisbrown,

response.write will not be able to see what's the problem, the display will be
"CRT ( A68LZU185 ), "
which looks very normal, but in the table, it's stored as a black box.
any idea?
 
Hello barramu,

[1]You assign farm variable (same name as the form), if that's what you want with no worry on the confusion.

[2] Replace chr(13) may sometimes not enough. Besides, chr(13) is just your guess.

[3]>>document.form1.farm.value = 'CRT ( A68LZU185 )[red],[/red]
Hope there is just some typo?

[4] I sometime use
[tt]response.write escape(objRS("farm"))[/tt]
to see what nonprintable characters are there (%nn). Maybe you can try.

regards - tsuji
 
Hi tsuji,

Thanks a lot for the reply.
I've found out what's the problem. I'm now replacing it with vbCrLf and it works fine now!

FARM=replace(Trim(objRS("farm")),vbCrLf," ")

thanks again :)

 
Sorry, I meant HTMLEncode, not HTTPEncode.

If you encode it before you print it, it will show you what character is offending. But if you already found a solution...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top