Some content on this site is available only to logged-in subscribers. Contact Us for information on becoming a subscriber.

InSource.Solutions | InSource Training | InSource Client Portal
InSource Solutions Logo
Log In Sign Up
InSource.Solutions InSource Training InSource Client Portal Log In Sign Up
  • Home
  • AVEVA InTouch
  • AVEVA InTouch Tech Notes

TN IT309 How to Connect to a SQL Database in InTouch

Last updated: February 20th, 2025

Description

  • Author: Brian Schneider
  • Published: February 20th, 2025

Details:

Description

This article from InSource Solutions shows you how to connect to a SQL database inside of InTouch.

  • Author: Daniel London
  • Published: 03/06/2018
  • Applies to: InTouch

Details

This article will walk you through how to use the SQLConnect() function to connect to a SQL database inside of InTouch.

The syntax for the script function is below:

SQLConnect(iConnectionId, mConnectString);

iConnectionID = A memory integer tag defined inside of InTouch that holds the connection ID number from SQL Server.

mConnectString = This is a memory message tag where the connection string is referenced in another part of the script/application. You can also type the full connection string information instead of using a message tag.

The connection string we will be using is:

mConnectionString = "Provider = SQLOLEDB.1; User ID = sa; Password = sa; Initial Catalog = SQL App; Data Source = DLTESTSVR";

Below is the script that will be used to connect to the database. I assigned this to an action animation for a pushbutton.

Line 1: I am assigning my connection string to the message tag that I defined.

Line 2: I am using the SQLConnect() function based on the syntax that was described earlier in this article.

Line 3: A memory message tag that I tied to a label to show if the script executes to list the status as connected.

sql database intouch
Give feedback about this article

Recommended articles

TN - 1240 Creating a Watchlist Using an Import File

Read More

Aveva Diagnostic Utility wwClient

Read More

TN 1242 Aveva Historian Storage Locations and Best Practices

Read More
Support Icon

CONTACT SUPPORT

How to reach us

10800 Midlothian Turnpike Tpke, Suite 209, Richmond, VA 23235

1.877.INSOURCE

Technical Support - 1.888.691.3858

Contact Us

  • InSource Solutions
  • InSource Training
  • InSource Client Portal
  • Log In
InSource Solutions Logo

© 2025 InSource Solutions. All Rights Reserved.

Knowledge Base Software powered by Helpjuice

Expand