vb查询oracle数据库并显示,vb中用ado查询oracle数据库的数据出现异常错误

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

Do While True

If Return_Tname(strBeginDate) <> "" Then

strSql = strSql & "select rownum 序号,dtlcardno   卡号             ,dtlbefbal/100   交易前卡余额     ," _

& "dtlamt/100      交易金额         ,dtlslamt/100    退售卡押金       ,dtlaftbal/100   交易后卡余额     ," _

& "dtldate     交易日期         ,dtltime     交易时间         ,dtlsettdate 结算日期         ," _

& "dtlposid    设备代码         ,dtlinntype  内部交易代码     ,b.valdesc   交易代码         ,dtlcdcnt    计数器           ," _

& "dtlcenseq   中心流水号       ,       " _

& "dtlposseq   设备流水号       ,       " _

& "dtlcity     城市代码         ," _

& "dtlstatid   站点代码线路代码,        " _

& "dtlerrcode  错误代码         ,dtlinnerr   内部错误代码             " _

& "from " & Return_Tname(Val(strBeginDate)) & " a,DictAccTypeTb b" _

& " where a.dtltxcode= b.outbusitype(+) and a.dtlcardno = '" & txtCrdNo.Text & "'"

If Trim(cmbTxnType.Text) <> "" Then

strSql = strSql & " and a.dtltxcode='" & Return_Id("outbusitype", "valdesc", cmbTxnType.Text, "DictAccTypeTb") & "'"

End If

strSql = strSql & " union all "

End If

strBeginDate = add_date(Val(strBeginDate), 1)

'If strBeginDate > Trim(txtEndDate.Text) Then

If strBeginDate > Format(dp2.value, "yyyymmdd") Then

If strSql <> "" Then

strSql = Mid(strSql, 1, Len(strSql) - 10)

Else

MsgBox "提示,此卡在指定时间段内没有交易明细!"

Exit Sub

End If

Exit Do

End If

Loop

strSql = "select rownum 序号,卡号             ,交易前卡余额     ," _

& "交易金额         ,退售卡押金       ,交易后卡余额     ," _

& "交易日期         ,交易时间         ,结算日期         ," _

& "设备代码         ,交易代码         ,内部交易代码     ," _

& "计数器           ,中心流水号       ,              " _

& "城市代码         ," _

& "设备流水号       ,        " _

& "站点代码线路代码,        " _

& "错误代码         ,内部错误代码             " _

& "from (" & strSql & ")"

'End If

'End If

'sort by cnt

strSql = strSql & " order by 计数器 "

Lab2:

'lBeginTime = Val(Format(Now(), "hhmmss"))

lBeginTime = GetTickCount

Adodc1.ConnectionString = GConnStr

Adodc1.RecordSource = strSql

'WriteStrSql strSql

Adodc1.Refresh

上面的代码的功能是查询一段时间内的交易记录,如果选择的交易时间超过三个月,有的时候偶尔会第一次查询的时候会正常一下,如果再查询其他的话,连提示都没有,就强行关闭运行程序!不知道是什么原因,异常也捕抓不到。。。�

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值