This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
How do I insert a newline with Orca/SQL?
Started by
dbritt
, Dec 30 2004 22:36
7 replies to this topic
Posted 30 December 2004 - 22:36
I'm trying to edit the BodyText of the FinishedForm and I've written a VBScript script to do it automatically for me. I have the SQL statements in a separate file and my script reads from the file and executes each line of SQL. I don't know how to get it to recognize the newline characters. When I put in \n it just displays the literal \n. I thought it might have been using RTF for the display, so I tried \par and that didn't work either. Please help.
Posted 31 December 2004 - 10:17
Have you tried vbNewLine ?
"Line one" & vbNewLine & "Line two"
"Line one" & vbNewLine & "Line two"
Stefan Krüger
InstallSite.org twitter facebook
Posted 31 December 2004 - 17:32
No, and here's why:
The script reads each line and uses the returned string directly...it wont interpret what it reads. Surely there's an escape sequence that the MSI file will recognize?
The script reads each line and uses the returned string directly...it wont interpret what it reads. Surely there's an escape sequence that the MSI file will recognize?
Posted 31 December 2004 - 23:31
QUOTE (dbritt @ 2004-12-31 17:32) |
No, and here's why: |
Edit:
Sorry, I re-read your question. Yes, I did test it. No it doesn't work.
Edited by dbritt, 01 January 2005 - 01:54.
Posted 03 January 2005 - 22:31
I found the problem. The textStream.readline() function returns a string from the file and doesn't perform any of the escape checking that JavaScript does when you create a new string. I wrote a small RegEx to parse out the \n and replace w/ a fresh \n which caused the escape to be recognized. This still does not solve the problem if I use ORCA and need to put a new line into there. I'd really like to know if the MSI execution prog has a special escape sequence that it will use for special characters in the MSI database. Like if I put a \n in there, I would like for it to be smart enough to display it as a new line. Do you know of anything that does this?
Posted 04 January 2005 - 21:12
No, MSI doesn't recognize such an escape character for newline.
Stefan Krüger
InstallSite.org twitter facebook
Posted 05 January 2005 - 10:10
I'm quite sure that the following works:
Record.StringData(fieldno) = "Line 1" & vbCRLF & "Line 2"
(I didn't test that construction, I used MsiRecordSetString)
I don't know how you can query for such records, don't be surprised if that's not possible.
Record.StringData(fieldno) = "Line 1" & vbCRLF & "Line 2"
(I didn't test that construction, I used MsiRecordSetString)
I don't know how you can query for such records, don't be surprised if that's not possible.