如何在vb6.0的换行符中连接sql查询?

时间:2011-03-15 13:04:37

标签: mysql vb6

我想连接不是单行而是换行的sql查询。

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

如何将它们连接成单个?

谢谢,
Yugal

2 个答案:

答案 0 :(得分:2)

在VB6中做一个续行,你用[space] [下划线]结束一行。你还需要使用&将每行上的文本段连接在一起。所以这条线看起来像这样:

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

答案 1 :(得分:0)

或许这样的事情:

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