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

Develop VB 6 routines for ACCPAC Pervasive SQL

Status
Not open for further replies.

ZABARVAN

IS-IT--Management
May 24, 2003
186
SA

HI,

We have been using ACCPAC for year and half, it is fully implemented. Now we are in need of some extra module / routine to browse data on screen. I have developed some programs in VB 6.0 my backend was access. Now I am thinking of developing some routines in visual basic 6.0 for ACCPAC using Pervasive SQL (LANPAK for Novell) as backend.
I shall be most grateful if you could help me to start this development, as I have no idea how to link with the database. A Sample Code to open and link the database will be apperiated.

Thanking You

Javed Ahmed

 
From VB you can access the actual Accpac database via the xAPI com interface supplied by Accpac. From here you can do almost anything Accpac can do and it will follow all of Accpac's business logic and rules through the use of views.

If you want a secondary backend database to store data you can use anything including Access.

You will need to add a reference to the ACCPACXAPI 1.1 type library in your VB project and then you are ready to go. The file is a4wcom.dll located in the accpac\runtime directory.

Declare a session object (scope is up to you, I use a global one declared in a module)

Public Session As ACCPACXAPILib.xapiSession

Open the session where you like,(The information you supply is user name, password and company name (in that order). The user can be any valid Accpac user for the company.

Set Session = CreateObject("ACCPAC.xapisession")
Session.Open "ADMIN", "ADMIN, "SAMINC", Date, 0

Now you are in. To open a view of AR customers do the following

Dim ARCUSTOMER As ACCPACXAPILib.xapiView
Set ARCUSTOMER = Session.OpenView("AR0024", "AR")
With ARCUSTOMER
.Init
.Order = 0
.Browse "IDCUST = " & g_strCustID & "", True
If .Fetch Then
<variable1> = Trim(.Fields(&quot;IDCUST&quot;).value)
<variable2> = Trim(.Fields(&quot;NAMECUST&quot;).value)
...etc....
End If
.Cancel
End With

You can use recorded macros from Accpac to see which views you need.

Unfortunatly there is not much helpful information on the xAPI from Accpac. Look up 'xAPI' in this forum for some more information and some examples.



Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top