Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with GL0003 view

Status
Not open for further replies.

tiju000

Programmer
May 23, 2008
2
CA
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
 
Replace the code after
mDBLinkCmpRW.OpenView "GL0003", viewGLFISC

with:

Code:
    Do While viewGLFISC.GoNext
            
         a = viewGLFISC.Fields("NETPERD1")
   
    Loop

 
well it was an acces problem. I used an account with no privilege in accpac. Whats interesting is that this account could access the GL0001 view but not the other one.

Thierry
 
Well GL0001 contains general information, no sensitive information there. If users have GL Common Inquiry rights then they will have read only access to GL0001.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top