tags:

views:

37

answers:

2

I want to insert a record using SQL and one of the fields needs to contain a carriage return, e.g.

Notes field:

Line 1 
Line 2 
End line

How would I code this SQL statement using VB

+1  A: 

When you build the insert statement, you store it in a string somewhere. Add an escaped newline character into the string wherever you want the carrage returns to be.

A simple way to do that in VB would be: Sql = Sql & vbCrLf

Jeff Wight
Thanks Jeff - I knew there had to be a simple way.
WaterBoy
+1  A: 

Using SQL code:

UPDATE MyTable
   SET MyCol = MyCol + CHAR(13) + CHAR(10);
onedaywhen