标准表达式数据类型不匹配。求老师们帮们检查。自己是在查不出来了。
本帖最后由 u013008175 于 2013-12-01 12:40:09 编辑 代码如下:
客户端:
Private Sub Command4_Click()
Dim strsql As String
Dim ScLength As Long
Dim ScData() As Byte
Dim ScJwBz() As Byte
Dim scclength As Long
strsql = Me.Text1.Text
ScData = StrConv(strsql, vbFromUnicode)
ScLength = UBound(ScData)
ScJwBz = "!!"
scclength = UBound(ScJwBz)
ReDim Preserve ScData(ScLength + 4)
CopyMemory ScData(ScLength + 1), ScJwBz(0), 4
If sockClient.State = sckConnected Then
sockClient.SendData ScData
End If
End Sub
服务端:
Private Sub sockServer_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim ScData() As Byte
Dim tmpdata() As Byte
Dim jsLength As Long
Dim strsql As String
Dim objRec As Recordset
Dim arrData() As Byte
Dim arrLength As Long
Dim jsfin As String, jsfindata(3) As Byte
Dim FinisData() As Byte
Dim cnn As New ADODB.Connection
Dim Rs As New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\wlbkcgl.mdb;Persist Security Info=False" '定义ADO连接字符
sockServer(Index).GetData tmpdata, vbArray + vbByte
jsLength = UBound(tmpdata)
CopyMemory jsfindata(0), tmpdata(jsLength - 3), 4
jsfin = jsfindata
If jsfin = "!!" Then
ReDim Preserve tmpdata(jsLength - 4)
strsql = StrConv(tmpdata, vbUnicode)
Debug.Print strsql
cnn.Execute strsql
Set cnn = Nothing
End If
End Sub
debug.print strsql
立即窗口显示如下:
Delete From [入库] Where 物料编号="1"
应该sql语句没错。
红色字体部分,报错,标准表达式数据类型不匹配。求老师们查找错误,拜谢!!!! 数据库
[解决办法]
如果“物料编号”是字符型,则:
Delete From [入库] Where 物料编号='1'
如果“物料编号”是数值型,则:
Delete From [入库] Where 物料编号=1