大神门帮帮忙啊。。这个实时错误是啥意思啊。怎么改啊。
Private Sub Timer1_Timer()
If MSComm1.InBufferCount = 6 Then
MSComm1.InputLen = 2
Text1.Text = MSComm1.Input
Text2.Text = MSComm1.Input
Text5.Text = MSComm1.Input
If Val(Text5.Text) = 1 Then
Shape4.BackColor = RGB(0, 255, 0)
End If
If Val(Text5.Text) = 0 Then
Shape4.BackColor = RGB(255, 0, 0)
End If
SD = y
y = Val(Text2.Text)
Picture1.Line (x + 9, 100 - y)-(x, 100 - SD)
x = x + 9
If x >= 120 Then
Picture1.Cls
x = 0
End If
If Val(Text2.Text) > Val(Text4.Text) Then
Shape2.BackColor = RGB(255, 0, 0)
Else
Shape2.BackColor = RGB(0, 255, 0)
End If
If Val(Text2.Text) < Val(Text3.Text) Then
Shape3.BackColor = RGB(255, 0, 0)
Else
Shape3.BackColor = RGB(0, 255, 0)
End If
If Val(Text5.Text = 2) & Val(Text2.Text) < Val(Text3.Text) Then
buff(0) = &H3
MSComm1.Output = buff
End If
If Val(Text5.Text = 1) & Val(Text2.Text) >= Val(Text3.Text) Then
buff(0) = &H4
MSComm1.Output = buff
End If
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("时间") = Now
Adodc1.Recordset.Fields("温度") = Val(Text1.Text)
Adodc1.Recordset.Fields("湿度") = Val(Text2.Text)
Adodc1.Recordset.Update//这句话报错 实时错误 80004005
End If
End Sub