Hi there,
I'm new to interfacing Accpac trought the view and I got a small problem.
I use accpac 5.4A
I want to read the view GL0003 so I went with the sample code
Dim Session As AccpacSession
Dim mDBLinkCmpRW As AccpacDBLink
Dim viewGLFISC As AccpacView
Set Session = CreateObject("ACCPAC.Session")
If Session.IsOpened Then
mDBlink2.Close
Session.Close
End If
Session.Init "", "DC", "DC1000", "54A"
Session.Open UserID, Password, DatabaseID, SessionDate, Flags, ""
Set mDBLinkCmpRW = Session.OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
mDBLinkCmpRW.OpenView "GL0003", viewGLFISC
viewGLFISC.Browse "", True
noMoreRecords = False
While Not noMoreRecords
On Error Resume Next
errcode = viewGLFISC.Fetch()
If errcode = 0 Then noMoreRecords = True
If Not noMoreRecords Then
On Error GoTo ErrHandler
a = viewGLFISC.Fields("NETPERD1")
End If
Wend
viewGLFISC.Close
I have datas in the table but the fetch always return 0 as if there's nothing in the DB.
What am I doing wrong.
tks
Thierry
I'm new to interfacing Accpac trought the view and I got a small problem.
I use accpac 5.4A
I want to read the view GL0003 so I went with the sample code
Dim Session As AccpacSession
Dim mDBLinkCmpRW As AccpacDBLink
Dim viewGLFISC As AccpacView
Set Session = CreateObject("ACCPAC.Session")
If Session.IsOpened Then
mDBlink2.Close
Session.Close
End If
Session.Init "", "DC", "DC1000", "54A"
Session.Open UserID, Password, DatabaseID, SessionDate, Flags, ""
Set mDBLinkCmpRW = Session.OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
mDBLinkCmpRW.OpenView "GL0003", viewGLFISC
viewGLFISC.Browse "", True
noMoreRecords = False
While Not noMoreRecords
On Error Resume Next
errcode = viewGLFISC.Fetch()
If errcode = 0 Then noMoreRecords = True
If Not noMoreRecords Then
On Error GoTo ErrHandler
a = viewGLFISC.Fields("NETPERD1")
End If
Wend
viewGLFISC.Close
I have datas in the table but the fetch always return 0 as if there's nothing in the DB.
What am I doing wrong.
tks
Thierry