I am new to the Sage 50 SDK. I am trying to write a sample program to connect to a sample company database. When I call the session "RequestAccess" method, it is always returning "AuthorizationResult.Pending". Do I need to pass a username and password? Is it supposed to pop-up a dialog box.
Sample code is shown below.
Const COMPANY_NAME As String = "Bellwether Garden Supply"
Const APPLICATION_ID As String = "IJ...sew=="
Dim oSession As New PeachtreeSession() oSession.Begin(APPLICATION_ID)
Dim oCompanyList As CompanyIdentifierList = oSession.CompanyList
Dim oCompany As Company
For Each oCompanyID As CompanyIdentifier In oCompanyList
Trace.TraceInformation("Company Name: {0} Path{1}", oCompanyID.CompanyName, oCompanyID.Path)
If (oCompanyID.CompanyName = COMPANY_NAME) Then
Dim oResult As AuthorizationResult = oSession.RequestAccess(oCompanyID)
' -- NOTE: oResult is ALWAYS AuthoriationResult.Pending
If (oResult = AuthorizationResult.Granted) Then
oCompany = oSession.Open(oCompanyID)
End If
End If
Next
oSession.End()