开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜