VB中 总是报”要求对象“的错误 具体过程如下

mrhomesick 2014-11-28 09:41:50
i = 1
Do While i <= 7
voucherentrys.Add
With Voucher.entries(Voucher.entries.Count)
.explanation = CStr(MSFlexGrid1.TextMatrix(i, 1))
Dim mrs As Object
Dim str As String
coNN.ConnectionString = K3Login.PropsString
coNN.Open

str = "select * from t_account where fnumber='" & MSFlexGrid1.TextMatrix(i, 2) & "'"
Set mrs = coNN.Execute(str)

.accountid = mrs("faccountid")

.amount = Val(MSFlexGrid1.TextMatrix(i, 5))
.amountfor = Val(MSFlexGrid1.TextMatrix(i, 5))
.exchangerate = 1
.currencyid = 1
If MSFlexGrid1.TextMatrix(i, 4) = "借" Then
.dc = 1
Else
.dc = 0
End If
End With


报错的地方已经标红 请行家解答,灌水走开
...全文
868 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
CX_ERP 2014-11-30
  • 打赏
  • 举报
回复
请问你的CONN有没有定义和实例化?
clear_zero 2014-11-28
  • 打赏
  • 举报
回复
你的K3Login在哪定义的? 这段代码完全是你写的么?

7,787

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧