当前位置:编程学习 > VB >>

关于字符串的连接问题

str2 = "update AllData set CGTTBRQ='" & Trim(Text1.Text) & "'," _
& "JHKH='" & Text9(0).Text & "'," _
& "GYCXSF=" & KONGTONULL(Text9(1).Text) & "," _
& "GYQD=" & KONGTONULL(Text9(2).Text) & "," _
& "JHLCXSF=" & KONGTONULL(Text9(3).Text) & "," _
& "JHL=" & KONGTONULL(Text9(4).Text) & "," _
& "ND=" & KONGTONULL(Text9(5).Text) & "," _
& "LS=" & KONGTONULLText9(6).Text) & "," _
& "PH=" & KONGTONULL(Text9(7).Text) & "," _
& "SYSF=" & KONGTONULL(Text9(8).Text) & "," _
& "BD1070=" & KONGTONULL(Text9(9).Text) & "," _
& "L1070=" & KONGTONULL(Text9(10).Text) & "," _
& "a1070=" & KONGTONULL(Text9(11).Text) & "," _
& "b1070=" & KONGTONULL(Text9(12).Text) & "," _
& "SS1070=" & KONGTONULL(Text9(13).Text) & "," _
& "SS11070=" & KONGTONULL(Text9(14).Text) & "," _
& "SSL1070=" & KONGTONULL(Text9(15).Text) & "," _
& "BD1180=" & KONGTONULL(Text9(16).Text) & "," _
& "L1180=" & KONGTONULL(Text9(17).Text) & "," _
& "a1180=" & KONGTONULL(Text9(18).Text) & "," _
& "b1180=" & KONGTONULL(Text9(19).Text) & "," _
& "SS1180=" & KONGTONULL(Text9(20).Text) & "," _
& "SS11180=" & KONGTONULL(Text9(21).Text) & "," _
& "XSL1180=" & KONGTONULL(Text9(22).Text) & ",cgttbcx='1' where id ='" & DataCombo1.Text & "'"

Public Function KONGTONULL(OBJ As String)
Dim OBJ1 As String
   'For Each OBJ In TextBox
      If Trim(OBJ) = "" Then
       KONGTONULL = "null"
      Else
       KONGTONULL = "'" & Val(OBJ) & "'"
      End If
   'Next
   
End Function

STR2里面究竟那里错 --------------------编程问答-------------------- str2 = "update AllData set CGTTBRQ='" & Trim(Text1.Text) & "'," _ 

改成 

str2 = "update AllData set CGTTBRQ='" & Trim(Text1.Text) & "',"  & _ 
补充:VB ,  基础类
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,