Article ID: 892700 - Last Review: July 25, 2011 - Revision: 5.0 How to use a VBA script to connect to a SQL database that is used by Microsoft Dynamics GP
INTRODUCTIONThis article describes how to use a Microsoft Visual Basic for Applications (VBA) script to connect to a Microsoft SQL database that is used by Microsoft Dynamics GP 9.0 and by Microsoft Business Solutions – Great Plains 8.0. MORE INFORMATIONThe following VBA script example can be used for the Description_AfterGotFocus event in the Microsoft Dynamics GP Account Maintenance window. This script will connect to the Microsoft Dynamics GP sample TWO database and log on as system administrator with a password. After the connection is made, the script creates a recordset of the data that is stored in the GL00105 account index master table. The script will then return the account index value to the User-Defined1 field in the Account Maintenance window. The script returns this value when you enter a new account or use the Account Lookup button. To use the example script, follow these steps:
Modifier/VBA Samples for Microsoft Dynamics GP 9.0 https://mbs.microsoft.com/customersource/support/documentation/howtoarticles/modifiervbasamples90.htmprintpage=false
(https://mbs.microsoft.com/customersource/support/documentation/howtoarticles/modifiervbasamples90.htm)
Modifier/VBA Samples for Microsoft Business Solutions - Great Plains 8.0https://mbs.microsoft.com/customersource/documentation/howtodocuments/modifiervbasamples80.htm
(https://mbs.microsoft.com/customersource/documentation/howtodocuments/modifiervbasamples80.htm)
A Readme file is included with each version of the .dll file The Readme file describes how to declare the variables. For example, you can declare the variables in your code and then use the variables in the connection string. | Other Resources Other Support Sites
Community |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top