k3接口

xiaqunfeng 2009-12-28 07:33:05
现在我们有一个项目,他们公司用的K3的财务软件,现在我们有些业务想实时的调用K3的财务凭证,所以我们尝试用vb来调用k3凭证接口,来达到新增凭证,默认是凭证的审核状态,由于我都VB之前都不是很了解,请各位大侠只能我一下
Private Sub Command1_Click()
Dim voucher As New KFO.Dictionary
Dim GlData As New EBCGLView.GlData
Dim GLView As New EBCGLView.GLView
Dim dtvect As KFO.Vector
Dim Dt As KFO.Dictionary
Dim obj As ADODB.Recordset
Dim ReturnCollection As Object
'vchdate = DateSerial(GlData.SystemProfile.GLGetCurrentYear, GlData.SystemProfile.GLGetCurrentPeriod, 1)
vchdate = DateSerial(2009, 12, 1)
voucher("FDate") = vchdate
voucher("FGroup") = "记"
voucher("FNumber") = Val(111)

Dim voucherentry As New KFO.Vector
Dim tempentry As New KFO.Dictionary

'Set tempentry = New KFO.Dictionary
tempentry("FExplanation") = "凭证录入检测-分录1"
tempentry("FAccountID") = 1014
tempentry("FCurrencyID") = 1
tempentry("FDC") = 1
tempentry("FAmountFor") = 100
tempentry("FAmount") = 100
tempentry("Fdebit") = 100
tempentry("Fcredit") = -100
Set dtvect = New KFO.Vector
Set obj = GlData.GetAccountItem(1014)
For i = 0 To obj.RecordCount - 1
Set ReturnCollection = GLView.ItemLookup(obj("FItemClassID"))
Set Dt = New KFO.Dictionary
Dt("FItemClassID") = ReturnCollection.ReturnObject.ItemClassID
Dt("FItemID") = ReturnCollection.ReturnObject.ItemID
dtvect.Add Dt
obj.MoveNext
Next i
Set tempentry("_Details") = dtvect
voucherentry.Add tempentry


Set tempentry = New KFO.Dictionary
tempentry("FExplanation") = "凭证录入检测-分录2"
tempentry("FAccountID") = 1045
tempentry("FCurrencyID") = 1
tempentry("FDC") = 0
tempentry("FAmountFor") = 100
tempentry("FAmount") = 100
Set dtvect = New KFO.Vector
Set obj = GlData.GetAccountItem(1045)
For i = 0 To obj.RecordCount - 1
'Set ReturnCollection = GLView.ItemLookup(obj("FItemClassID"))
Set Dt = New KFO.Dictionary
'Dt("FItemClassID") = ReturnCollection.ReturnObject.ItemClassID
'Dt("FItemID") = ReturnCollection.ReturnObject.ItemID
dtvect.Add Dt
obj.MoveNext
Next i
Set tempentry("_Details") = dtvect
voucherentry.Add tempentry

Set voucher("_Entries") = voucherentry

Dim cre As Object, voucherid As Long
Set cre = CreateObject("EBSGLVoucher.VoucherUpdate")
voucherid = cre.Create(k3login.PropsString, voucher)
Set cre = Nothing

End Sub

报错的是这句Set obj = GlData.GetAccountItem(1014) ,报的错是没有发现数据源名称且没有制定默认驱动程序,大哥们,急啊!

...全文
285 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
xupeihuagudulei 2009-12-29
  • 打赏
  • 举报
回复
楼上的广告也真够恶心的。
use_zj 2009-12-29
  • 打赏
  • 举报
回复
纯顶
解释多余的 2009-12-29
  • 打赏
  • 举报
回复
mark
1dit 2009-12-29
  • 打赏
  • 举报
回复
排队领分,楼下保存队形...
lang_csdn 2009-12-29
  • 打赏
  • 举报
回复
直接读数据表!
kingcsx666 2009-12-28
  • 打赏
  • 举报
回复
直接Select他的凭证表Voucher,都用自己的方法读数据出来,整理后写到你的数据库就好啦
贝隆 2009-12-28
  • 打赏
  • 举报
回复
帮顶
silentwins 2009-12-28
  • 打赏
  • 举报
回复
你要找到他的定义才行啊!你给我们这样的,我们也没办法知道他干啥了!

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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