This topic is locked

character spaces

2/25/2006 10:38:00 PM
ASPRunnerPro General questions
Sarjent author

What can I do so that values are stored with a

&#160

instead of an actual space between words. Or is it possible to execute a record update after the record is saved to modify that field using something like

UPDATE mytable

SET Description = REPLACE(LTRIM(RTRIM(Description)), ' ', '&#160')


Thanks

Sergey Kornilov admin 2/26/2006

Use BeforeEdit/BeforeAdd events to replace space with Chr(160):

dict("FieldName") = Replace(dict("FieldName", " ", Chr(160))
Sarjent author 2/26/2006

Use BeforeEdit/BeforeAdd events to replace space with Chr(160):

dict("FieldName") = Replace(dict("FieldName", " ", Chr(160))


I used this code and get an error

dict("Description") = Replace(dict("Description", " ", Chr(160)))


Error number 450

Error description Wrong number of arguments or invalid property assignment

URL /photo/tst/Photo_Path_add.asp

SQL query select [UID], [CODE], [Misc], [Description], [Rdate] From [dbo].[Photo_Path] where (1=0)

Additional info Event: RetVal = BeforeAdd(dict)
I added an extra ) to the end of your statement because the arguement wasn't closed.
I also looked into the debug and it didnt really say anything different

Sergey Kornilov admin 2/26/2006

Here is the correct one:

dict("Description") = Replace(dict("Description"), " ", Chr(160))