vb 3265错误!大求救!!!

[复制链接]
查看11 | 回复1 | 2009-3-8 21:59:21 | 显示全部楼层 |阅读模式
Private Sub cmdInfo_Click()
Dim rsObj As New adodb.Recordset
Dim SqlStr As String
Dim szVSNO As String
Dim Remark As String
Dim sNow As String
Dim szEnterTime As String
Dim UsrID As String
Dim VsName As String
szVSNO = Replace(txtVSNO.Text, "'", "''")
SqlStr = "SELECT * FROM VisitorInfo WHERE VisitorNO ='" & szVSNO & "'"
Call rsObj.Open(SqlStr, DBCnn, adOpenKeyset, adLockReadOnly)
If rsObj.RecordCount 这句老说是3265错误
If bAlreadyExit Then

txtCost.Text = rsObj("Hours")

txtCost.Enabled = False

dtpExitTime.Enabled = False

Timer1.Enabled = False

dtpExitTime.Value = rsObj("ExitTime")

MsgBox "输入的ID号已经出场了,下面将显示它的详细信息", vbInformation
Else

txtCost.Text = CalculateTime(rsObj("EnterTime"), Now)

txtCost.Enabled = True

'如果计算成功, 那么可以提交车辆出场信息了

m_bIsReadyToSubmit = True

CmdRecord.Enabled = True

dtpExitTime.Enabled = True

Timer1.Enabled = True
End If
End Sub
自己怎么看都觉得代码没问题,就想不通了,哪儿的问题啊???

回复

使用道具 举报

千问 | 2009-3-8 21:59:21 | 显示全部楼层
可能出现的情况有二:1、你数据表中没有ExitTime这个字段;2、字段中不是null,而是空串,你把IsNull(rsObj("ExitTime"))改成rsObj("ExitTime")=""试试看。...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行