Dear All,
Can I use code below to connect Accpac in asp.net web service (it is fine in windows form application)?
Dim Session As New AccpacSession
Dim mDBLinkCmpRw As AccpacDBLink
Dim mSessMgr As AccpacSessionMgr
Dim mlSessionID As Long
'Open Session
mlSessionID = 0
mSessMgr = Nothing
Session = Nothing
If mSessMgr Is Nothing Then
mSessMgr = CreateObject("Accpac.SessionMgr")
With mSessMgr
'Set the session manager's properties.
.AppID = "XY"
.AppVersion = "61A"
.ProgramName = "XY0001"
End With ' mSessMgr
End If
'Only create the session if it doesn't already exist
If Session Is Nothing Then
mSessMgr.CreateSession("", mlSessionID, Session)
mDBLinkCmpRw = Session.OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
End If
Error:
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at AccpacSessionManager.IAccpacSessionMgr.CreateSession(String ObjectHandle, Int32& SignonID, AccpacSession& Session)
Can I use code below to connect Accpac in asp.net web service (it is fine in windows form application)?
Dim Session As New AccpacSession
Dim mDBLinkCmpRw As AccpacDBLink
Dim mSessMgr As AccpacSessionMgr
Dim mlSessionID As Long
'Open Session
mlSessionID = 0
mSessMgr = Nothing
Session = Nothing
If mSessMgr Is Nothing Then
mSessMgr = CreateObject("Accpac.SessionMgr")
With mSessMgr
'Set the session manager's properties.
.AppID = "XY"
.AppVersion = "61A"
.ProgramName = "XY0001"
End With ' mSessMgr
End If
'Only create the session if it doesn't already exist
If Session Is Nothing Then
mSessMgr.CreateSession("", mlSessionID, Session)
mDBLinkCmpRw = Session.OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
End If
Error:
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at AccpacSessionManager.IAccpacSessionMgr.CreateSession(String ObjectHandle, Int32& SignonID, AccpacSession& Session)