7,763
社区成员
发帖
与我相关
我的任务
分享
strsql="Insert Into Table(Str1,Str2)Values("& iif(len(text1(0).text )>0,"'" & text1(0).text & "'","null")&", '"& text1(1).text&")"
sql = "Insert Into Table(Str1,Str2)Values(" & _
"NULLIF('" & Text1(0).Text & "', '')," & _
"NULLIF('" & Text1(1).Text & "', ''))"
Function SQLStr(ByVal Text As String) As String
If LenB(Text) = 0 Then
SQLStr = "NULL"
Else
SQLStr = "'" & Text & "'"
End If
End Function
sql = "Insert Into Table(Str1,Str2)Values(" & _
SQLStr(Text1(0).Text) & "," & _
SQLStr(Text1(1).Text) & ")"
strsql="Insert Into Table(Str1,Str2)Values('" & iif(len(text1(0).text )>0,text1(0).text,null) & "', '" & text1(1).text & "')"
Insert Into Table(Str1,Str2)Values('" & iif(len(text1(0).text )>0,text1(0).text,null) & "','" & text1(1).text & "')