Skip to content


Tech Tuesday is back and not just on Tuesdays.

Scripting and database connections.

The ability to create and run scripts within SmartConnect when processing maps is a great asset to the SmartConnect community. However it can raise issues about password security.

When a script requires connection to a database, and other users have access to the map setup screen, it is a simple exercise to open the map, open the script and read the database login details from the script window.

An additional issue is what happens if the database credentials change, and I need to update the script? You would need to remember everywhere you used those credentials in a script, then find and update the script. You have probably thought that surely there is a better way to both manage connection credentials, and hide restricted information?

Well now there is.

As of SmartConnect ( for those connecting to GP 10) all default connections are available for use as variables within the scripting windows. What does that mean for those users maintaining and creating scripts? Well firstly it means setting up and maintaining database connection details in a single place. If the database connection required is to a MSSQL or GP database, or to an ODBC or OLEDB compliant database the connection can be setup up under default connections. (Setup / Generic Defaults / then MSSQL, ODBC or OLEDB data source defaults, or Setup / Dynamics GP Defaults / Dynamics GP Query for GP connections). These connections can then not only be used in the relevant data source windows, but can also be used in scripting.

When opening the scripting task on a SmartConnect map, there is now a Default Connections node in the tree on the left. Expanding the node will give you the different types of connections that have been defined, and expanding the type will give a list of each connection of the selected type. The connection can then be dragged into the script window and used in scripting. How is it used? Let’s look at an example.

Originally your script would look something like this:
Dim conString as String = “DataSource=MYSERVER;Initial Catalog=MYDATABASE;User=UserName;Password=UserPassword;”

The new script would look something like this:
Dim conString as String = _SQLDEF_MYDATABASE

You will have noticed that using the default connection also removes all credential information from the script. It can no longer be read directly from the scripting window. You can also use the same default connection in other scripts, but only update the single default connection if something changes. With SmartConnect, Yes you can have easy script access, with easy database connection maintenance, while still maintaining security around connection credentials.


1 Comment

  1. Aldus Logan on March 14, 2012 at 6:39 am

    I am so glad to view this informative blog. Thanks for the sharing….

    online business software

Leave a Comment


eOne Welcomes Incremental Group as a New eOne iPaaS Integration Partner
Employee Spotlight: Floyd Jones, Front End Developer
NEW WEBINAR: Popdock Onboarding - Fall in Love with Your Data
Employee Spotlight: Calum McGrath, Implementation Consultant
A Pricing Update Regarding the SmartConnect Perpetual Plan


2016 SmartConnect Integration Bootcamps
Tech Tues: Automatically refreshing Pivot Tables in Excel Refreshable Reports
Happy Thanksgiving from the eOne team!
2017 SmartConnect Integration Bootcamps
New Releases of Extender and SmartList Builder



Business Central CRM D365 Business Central Dynamics 365 dynamics crm Dynamics GP Dynamics NAV Econnect Employee Spotlight eone eOne News error Error Message Events Excel Excel Report Builder Extender Flexicoder GP integration Map Meet the Team Microsoft dynamics crm Microsoft Dynamics GP Navigation List Builder Office Relationships Partner All Hands Call Popdock promotions release SalesForce SmartConnect SmartConnect Bootcamp SmartConnect Maps SmartConnect Office Hours SmartList SmartList Builder SmartPost SmartView SQL Tech Tuesday Templates training

Integrate & Automate without Any Code.

SmartList Data has Never Been Faster.

The Easiest Way to Report on GP Data.