Dim p1 As Integer
For p1 = 0 To Check4().UBound
If Check4(p1).Value = 1 Then
Text4.Text = Check4(p1).Caption
With DataEnvironment1.rsCommand1
.Delete "select * from 3d where 大小比 <> '" & Val(Text4.Text) & "'"
Set DataGrid1.DataSource = DataEnvironment1.rsCommand1
End With
End If
Next
当中.Delete "select * from 3d where 大小比 <> '" & Val(Text4.Text) & "'"运行时出错“类型不匹配”
For p1 = 0 To Check4().UBound
If Check4(p1).Value = 1 Then
Text4.Text = Check4(p1).Caption
With DataEnvironment1.rsCommand1
.Delete "select * from 3d where 大小比 <> '" & Val(Text4.Text) & "'"
Set DataGrid1.DataSource = DataEnvironment1.rsCommand1
End With
End If
Next
当中.Delete "select * from 3d where 大小比 <> '" & Val(Text4.Text) & "'"运行时出错“类型不匹配”
要与 '" & Val(Text4.Text) & "' 这个字符型相匹配!
如果是SQL server
DataEnvironment1.connenction1.exec "delete from 3d where 大小比 <> '" & Val(Text4.Text) & "'"
.Delete "select * from 3d where 大小比 <> '" & trim(Text4.Text) & "'"
DataEnvironment1.rsCommand1.Delete要求的参数应该是一个Long,你传给它一个字符串,它当然不干活。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
那就转换啊 int()
不好用DataEnvironment1.connenction1.exec "delete from 3d where 大小比 <> '" & Val(Text4.Text) & "'"也不好用