开发者

How do you put a carriage return into the field of an SQL statement using VB?

开发者 https://www.devze.com 2023-01-18 03:04 出处:网络
I want to insert a record using SQL and one of the fields needs to contain a carriage return, e.g. Notes field:

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

H开发者_如何学编程ow would I code this SQL statement using VB


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


Using SQL code:

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号