Skip to main content
InSource Solutions

TN AppSvr328 Application Server scripts that use OLEDB to INSERT, UPDATE, and SELECT in a Database

Description

This article from InSource shows you how to write AVEVA/Wonderware Application Server scripts that use OLEDB to INSERT, UPDATE & SELECT in a SQL database

  • Author: Bruce Telford
  • Published: 06/29/2020
  • Applies to: System Platform 2014 R2 and higher

Details

I have been asked how to script to and from databases other than using the SQL Server “SqlClient” as in a previously published document “Application Server scripts that INSERT, UPDATE & SELECT in a SQL database” with ADO. This is best done using OLEDB, as this can be used for nearly all databases if you modify the connection string as required by the database and slight modifications to the SQL Syntax for the required database used. I have used OLEDB for Oracle, SQL Server and MS Access previously. These examples are for SQL Server below, but apply for any other DB’s as explained.
The following OLEDB SQL scripts show you how to do the following transactions to/from a database table in AVEVA/Wonderware Industrial Application Server:


1.    Construct a connection string hosted in a single object
2.    An INSERT of data into a SQL database table
3.    An UPDATE of an existing record in a SQL database table by providing filter criteria
4.    A SELECT query that retrieves a single record of data from a database by providing filter criteria

See the attachment for the scripts and configurations