Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 newline char in DB

Author  Topic 

PeterG
Posting Yak Master

156 Posts

Posted - 2003-02-12 : 15:32:11
I am reading a text area entry (with line feeds) from my asp and storing this in my SQL Server database. It writes ok (in three lines if there are three lines) in the DB but when I read this value from the DB and write it into an Excel file, the output doesn't look good. The text area entries are not written in one cell, but are written in 3 cells.

My idea is to get rid of the new line characters in ASP before I write the entry into the database. That way it would be stored as 1 line in the database. Then when I read the value in Excel, it would all be shown in one cell. In ASP, I've tried Replace(textareaEntry,vbcrlf," ") and it doesn't work. I also tried vblf instead of vbcrlf.

Is there a fix I could use in the database itself? Maybe in the SP before inserting or when selecting for output in the Excel file?

Your suggestions? Thanks.

PeterG
Posting Yak Master

156 Posts

Posted - 2003-02-12 : 15:50:48
oops, replace actually works. i looked at the code and i was inserting the unreplaced string. duh!

Go to Top of Page
   

- Advertisement -