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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging in with an IAP license 1

Status
Not open for further replies.

JoeAtWork

Programmer
Jul 31, 2005
2,285
CA
Hello good folks of the forum.

In my current code I am using the following to connect to AccPac (this is C# code):
Code:
	accpacSession = new AccpacCOMAPI.AccpacSession();

	accpacSession.Init("", apAppID, apProgramName, apVersion);
	accpacSession.Open(apUserID, apPassword, apDatabaseID, DateTime.Today, 0, "");

I am assuming this uses up a license on Accpac. I have been told there is something called an IAP, used for integration of third party apps, which doesn't use up one of the regular licenses. If this is correct, how would I change my code to use it?

My environment:
AccPac Advantage Series, 5.3A, SP 3
Pervasive database
 
Thanks for the reply Jay.

I guess this means there's no way to do this with the COMAPI? In that case, I think I'll try another tactic, since I don't want to rewrite my entire application.

The goal here is to reserve one of the licenses for my application. Is there a way in Accpac to reserve a license for one particular user? For example, could I make user "VIPUser" and have my app be the only one using that login. Then, out of five licences, only four would really be available to the other users.

The only other alternative is to always have my app logged in, but it is a web service and I'm not sure if I can keep it going when there are no active sessions (I'll have to do some research on the ASP.NET forums).
 
BTW, I wouldn't mind seeing example code using the XAPI to log in. Even if I don't use it this time around, maybe I can try it for my next project.
 
I don't know about "reserving" licenses, I've never tried. But if two people ran the same app, you'd use up two licenses.

I haven't done any ASP coding with the XAPI, but here's the syntax for a VBA session from some of my old code:

Dim Session As ACCPACXAPILib.xapiSession
Dim ApTrans As ACCPACXAPILib.xapiView
Set Session = CreateObject("ACCPAC.xapiSession")
Session.Open "ADMIN", "ADMIN", "SAMINC", Date, 0
Set ApTrans = Session.OpenView("AP0028", "AP")


Jay Converse
IT Director
Systemlink, Inc.
 
Thanks again.

The code looks similar. I wonder if I could search and replace the object declarations and leave the majority of the rest of the code as is?

When I said "application", I should have mentioned it's a web service. Users generally go through a web page that in turn uses the web service to push data into Accpac. So although there are multiple users, the web service only has to open an Accpac session once.
 
Then it sounds like you're good to go.

My experience with the differences between XAPI and COMAPI is that once you've initialized and opened the objects, normal syntax is virtually identical, unless you try to use COMAPI-specific methods. Top-of-my head, I forget what they all are (the .Goxxxx methods definitely know don't exist), but if you're just doing vanilla stuff like .Browse, .Insert, .Update, and .Delete, you'll be fine.

Jay Converse
IT Director
Systemlink, Inc.
 
From what I understand COMAPI is a wrapper around the original xAPI. In other words the COMAPI uses the xAPI. The COMAPI provides a better programming interface with more methods, events, properties etc..

zemp
 
Zemp -

You're 100% correct, it's just a wrapper. According to Accpac's R&D director, there are no plans to get rid of the xAPI because so much third-party code depends on it.

Jay Converse
IT Director
Systemlink, Inc.
 
I'm new to the ACCPAC sence and found that this is the most resourceful (and about the only) forum around that has threads dedicated to ACCPAC.

Thumbs up to jayconverse, a number of your earlier posts have ready helped me to get things going.

The COM API is essentially the SDK stuffs, correct? I found that doing things in SDK is extremely complex, well, not difficult but longwinded. I have to do so many things just to integrate a new group with a couple of items into the desktop. Anyone feel the same?
 
Hey guys,

Does the Session object in the XAPI library have the equivalent of the IsOpen method that is in the COMAPI library?

How would I check if a Session has been opened?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top