Developing for Dynamics GP

by David Musgrave (Perth, WA, Australia) and the Microsoft Dynamics GP Developer Support Team (Fargo, ND, USA)

VBA - Preventing Users from logging into multiple companies Example

VBA - Preventing Users from logging into multiple companies Example

  • Comments 4

Microsoft Dynamics GP uses concurrent licensing which provides for a maximum number of users logged into the system at any one time.  Each time a user logs into a company, one license is used.

On systems with more than one company, users may use multiple instances of the application running on their system to log into a number of companies at the same time.  This might use up more licenses than expected and thus prevent other users from logging in.

This sample uses Visual Basic for Applications (VBA) and ADO (ActiveX Data Objects) to create a connection to SQL Server. Using this connection, the script will check the tables and confirm that the user is not already logged into another company and if they are it will stop the login from proceeding.

This code also includes a VBA based method of Hiding the Fabrikam sample company date dialog as well as the commented out code for the VBA - Preventing the User Login Activity window from opening Example.

NOTE: The method of opening an ADO connection to SQL Server differs for each version. v8.00 uses the external RetrieveGlobals.dll, v9.00 use the external RetrieveGlobals9.dll and v10.00 uses the built-in UserInfoGet object. v10.00 will need at least Service Pack 1 to use this sample. 

Example code for v8.0, v9.0 & v10.0 is attached at the bottom of the article.

Please see the "Installation Instructions.txt" file in each version's archive for more information.

Attachment: Prevent User Logging In To Multiple Companies.zip
Page 1 of 1 (4 items)
Comments Information

PLEASE READ BEFORE POSTING

Please only post comments relating to the topic of this page.

If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.

Leave a Comment
  • Please add 3 and 8 and type the answer here:
  • Post