开发者

how to concatenate sql query in newline in vb6.0?

i want to concatenate sql query that is not in single line but new line .

Conn.Execute "insert into users("
"FirstName,"
"LastName,"
"Address1,"
"Address2,"
")values("
" UCase(txtfirstname.Text) &" ,
"& UCase(txtlastname.Text) &",
" & UCase(txtaddress1.Tex开发者_如何学Ct) & ",
" & UCase(txtaddress2.Text) & "
")"

how to concatenate them into single one?

Thanks ,

Yugal


In the VB6 to do a line continuation you end a line with [space][underscore]. You also need to use the & to concatenate the text segments on each line together. So the line would look something like this:

Conn.Execute "insert into users(" _
& "FirstName," _
& "LastName," _
& "Address1," _
& "Address2" _
& ")values(" _
& UCase(txtfirstname.Text) & "," _
& UCase(txtlastname.Text) & "," _
& UCase(txtaddress1.Text) & "," _
& UCase(txtaddress2.Text) _
& ")"


Something like this perhaps:

Conn.Execute "insert into users(FirstName, LastName, Address1, Address2) values('" & UCase(txtfirstname.Text) & "', '" & UCase(txtlastname.Text) & "', '" & UCase(txtaddress1.Text) & "', '" & UCase(txtaddress2.Text) & "'")"
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜