Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Information about the new connection objects in VBA that replace the RetrieveGlobals.dll and RetrieveGlobals9.dll files in Microsoft Dynamics GP 10.0


INTRODUCTION

In earlier versions of Microsoft Dynamics GP, one of the following files is used to retrieve the username of the user and the password of the user who is currently logged into Microsoft Dynamics GP:
  • The RetrieveGlobals.dll file
  • The RetrieveGlobals9.dll file
The RetrieveGlobals.dll and RetrieveGlobals9.dll files create a connection string in Microsoft Visual Basic for Applications (VBA) code. This connection string does not require the user to hard code the username and password.

↑ Back to the top


More Information

In Microsoft Dynamics GP 10.0, new connection objects were added to the VBA code. These new connection objects replace the RetrieveGlobals.dll and RetrieveGlobals9.dll files in Microsoft Dynamics GP. This new VBA code lets you create an active connection based off the username and password of the user who is currently logged into Microsoft Dynamics GP. This new connection object is named UserInfoGet. This UserInfoGet connection object enables you to use the following properties and methods:
  • The CompanyName property
  • The CreateADOConnection method
  • The IntercompanyID property
  • The UserDate property
  • The UserID property
  • The UserName property
The following is a sample of code of the new UserInfoGet connection object.
Dim cn As New ADODB.connection
Dim rst As New ADODB.recordset
Dim cmd As New ADODB.Command

Private Sub PushButtonM79_AfterUserChanged()
cmd.CommandText = "Select * from RM00101"
Set rst = cmd.Execute
MsgBox (rst!custnmbr)
End Sub

Private Sub Window_AfterOpen()
Set cn = UserInfoGet.CreateADOConnection
cn.DefaultDatabase = UserInfoGet.IntercompanyID
cmd.ActiveConnection = cn
End Sub

↑ Back to the top


References

For more information about the RetrieveGlobals.dll and RetrieveGlobals9.dll files, click the following article number to view the article in the Microsoft Knowledge Base:

913341 How to use the new RetrieveGlobals9.dll file in Integration Manager and in Microsoft Dynamics GP 9.0

↑ Back to the top


Keywords: kbnosurvey, kbhowto, kbexpertiseinter, kbexpertiseadvanced, kbmbsvba, kbmbspartner, kbinfo, kbmbsmigrate, kb

↑ Back to the top

Article Info
Article ID : 936115
Revision : 1
Created on : 3/13/2017
Published on : 1/10/2015
Exists online : False
Views : 172