Diagnosing Problems Running Accpac Part 2
Last time we looked at what happens from when you double click on the “Sage Accpac ERP” icon to the sign-on dialog appearing. This time we will look at what happens when you click ok on the sign-on dialog through to when the desktop is displayed and ready to go.
When Accpac loaded the sign-on dialog with the company list, it kept track of whether security is turned on for that company/system database. This information is stored in orgs.ism. Accpac will then validate the user name against accpacshareddata\site\users.ism. If security is enabled it will also validate the password.
If you are having trouble signing on, first run DBSpy. If nothing appears in DBSpy then the problem is before opening the database links and will be to do with something in the accpacshareddata\site directory. Run ScanIsam to ensure the various ism files are ok. Sometimes ScanIsam can even fix them. Also remember that every user must have full control security access to all the files in the site directory.
Next Accpac will try to reserve a lanpak slot for this workstation/company/userid combination. If there is a free slot then you will be allowed to proceed, if not you will get an error message that all the lanpaks are in use. You can use the Desktop menus to see how many lanpaks are available and how many are used and which userid/company combinations are using them. If you think they should be available make sure the lanpaks aren’t expired 30 day licenses. If everyone is out of the system, it is safe to delete the site\lanpak.bin file. It will be re-created the next time you run Accpac. To do all this the desktop runs the a4wLPMgr.exe program which then tracks the lanpak usage for this workstation.
Accac will now run the Accpac Signon Manager (a4wSignonMgr.exe). This isn’t required by the Desktop, but is run so if anyone starts a UI program from outside the desktop, it can connect to this to share the signon info. You see this running in the icon tray in the bottom right of your screen. If the signon manager doesn’t run as part of the desktop startup process, you may have a problem with the Accpac COM components. The best bet is to re-register these by running accpac\runtime\regacc.exe. This program will register all the Accpac COM components, normally this is run by the Accpac installation program, but sometimes parts of this can fail.
Accpac then needs to register with semaphore.bin that you are using this company. If someone has the company open exclusively (for something like Database Load) then you will get an error to that effect. Otherwise this is accomplished by using some more byte locks on this file.
Now Accpac is ready to actually open a database connection. With 5.5A and later we just open a connection to the company database. Prior versions will also open a connection to the system database. However the steps taken are similar for both. Encrypted within the records in orgs.ism is sufficient information for Accpac to sign-on to the database. This is the information you entered in Database Setup. Depending on the database, Accpac will use database client software to login to the Database Server. For Pervasive we connect to both the transactional engine using the Pervasive client as well as to the relational engine using ODBC. For SQL Server and Oracle we connect using ODBC. For newer versions of Accpac we login to SQL Server using the SQL Native Client OBBC driver. All of these require that the database’s client software be installed on the workstation and that the directory where the client DLLs are located are in the PATH environment variable. This is true even if using an ODBC only connection. For SQL Server, you used to not see this since MDAC and many other pieces of Microsoft software install the SQL Server client software. However with the introduction of the SQL Native Client, this wasn’t included in MDAC and now requires the client software be installed. As a best practice its best to install the client software from the DVD that you installed the database server with, on every workstation. Accpac 5.6 will now install the SQL Native Client as part of its install to save hassle. But say if once we support SQL Server 2010, then you would want that client software installed on every workstation rather than the SQL Server 2008 client installed by 5.6A. A very common cause of support calls are the result of people running client software that is older than the version of the database server. Its seems to usually be ok to run new versions of the client software, but older versions seem to always lead to problems. If you are having database connection problems, try running the “Enterprise Manager” software that came with the database to see if it can connect ok, if not often it has some helpful advice (or at least an error message you can Google). For database connection problems its often useful to look through the database vendor’s knowledgebase to see if someone else has experienced and solved a similar problem. For Pervasive problems are often associated with setting up the workstation and server ODBC datasources correctly. Setting up Oracle can be tricky, but usually if you can test the ODBC connection successfully then Accpac will work. The first thing Accpac checks when connecting to the database is whether the version of the database client and server software is supported. Getting back strange errors from these calls will often result in a “Database version is unsupported” error. If you are sure the version is correct, then this is probably a result of a connectivity problem that confused Accpac checking the version.
Once you start connecting to the database, DBSpy becomes the tool of choice. It will record all diagnostics from the database to hopefully help you diagnose the problem. Googling any error messages usually yields good clues as to what is going wrong. Most databases also have tracing facilities that can be quite helpful in diagnosing problems. If you are running on Terminal Server and have run the Web Deployment Wizard and chosen the DCOM protocol, then you have to run DBSpy (or RVSpy) from the console, they will always come up blank from a terminal server client, best solution to this is to run the Web Deployment Wizard again and choose .Net Remoting as this doesn’t have the problem and works much better.
Once a database connection is successfully established, Accpac will read through the CSAPP table. This contains the list of application (like AP, AR, etc.) along with their version and datalevel. For AS and CS it will see if these need to be activated to the current version of System Manager or if these are ok. Perhaps we’ll talk about data activation in a later posting. But basically we get the list of applications and their versions that are activated for this company. You can see this occur in DBSpy.
Now Accpac will go through this list and construct the path accpacprograms\applicationversion (say accpac\ar56a) and try to load the roto.dat file there. This file contains the list of all the Views (Accpac Business Logic Objects) and User Interface objects for a given application. (There are some variants on roto.dat for applications that sub-class other applications that will also be read at this time). With these loaded, Accpac now knows how to run any UI or View for that application.
Now that a user is signed-on to a company, Accpac will read the accpacshareddirectory\user\userid\orgid.wsp file. This contains the layout of the various desktop panes from when the user was last signed on. This file can be safely deleted and will be re-created when the user next signs on.
The desktop is now ready to start constructing the tree of icons it displays. Again the desktop goes through the list of activated applications and for each one looks in its language specific directory for grp.dat (perhaps ar56a\eng\grp.dat). This file contains all the icons to display on the desktop along with their captions and which program to run when they are double clicked.
As the desktop loads the icons from the group file, the accounting application has the option to hide some of the icons. The desktop looks in the application’s xx.ini file (say ar.ini) and in the section [callbacks], if there is a startupIcon entry then the desktop will call the specified DLL for each icon, so the application can hide it. This is why the icons for multi-currency related activities like revaluation don’t show up when you sign into a single currency company.
One problem that we see now and then is people installing a larger product update that includes updated grp.dat and roto.dat files. If the base application wasn’t installed, but the application was activated (like they all are in sample data) then the desktop will pick up the roto.dat and grp.dat and display the icons for this application. But since it’s a product update, it isn’t complete, so clicking on the icons leads to all sorts of missing file errors.
Once the standard desktop icons are loaded, the desktop will load all desktop customizations. These are stored in the accpacshareddata\user\userid\orgid_c.ism. This file contains any icons that the user has added to the desktop for this company. There is also a accpacshareddata\user\_EVRYONE\orgid_c.ism file that contains icons added to the desktop and set for all users. Since these are Accpac ISAM files, if there are problems with loading custom icons, run ScanIsam to see if there are problems. If so perhaps ScanIsam can fix them. If you don’t mind losing your customizations you can delete these files and the will be re-created the next time you run Accpac.
If you are running multiple Window’s users on a workstation and are running Vista or Windows 7, you might run into problems with the operating systems file shadowing feature. The ideas of this was to shield the changes to files that one user makes from other users. However in multi-user applications this tends to cause havoc. Your best bet is to install Accpac to a location where this feature isn’t enabled (ie anywhere except under Program Files). Otherwise changes one user makes, say be running Database Setup won’t be visible to other users. This is further complicated by Windows Services which run as another user and installation programs which get aliased to run as the Administrator account.
Now the desktop should be signed in. The next step is to run an Accpac screen by double clicking on an icon. Next week we’ll look in detail at the steps that happen when you run an Accpac VB screen.