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 ,
YugalIn 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) & "'")"
精彩评论