Skip to main content
InSource Solutions

Use the SQLData Object to Read and Update a SQL Database

InSource Logo        TECHNOTE

Description

 

Use the SQLData object to read and update data from a SQL Server Database

 

Author

Joseph Hefner

Publish Date 1/14/2011

Applies to Software

Application Server, Microsoft SQL Server

Applies to Version

3.0 and greater

Applies to System/Module

Scripting

Article Version

1.01.01

 

 

Problem Statement

 

 

User would like to know how to setup and use the SQLData object to connect to and Navigate a SQL Server Database

 

 

Solution Details

 

To demonstrate how the object works I have created the following SQL Database called SQLDATATEST with 4 records included in it.

SQLData1.png

 

Step 1)  Create a New Instance of the SQLData template by right clicking on it and choosing New \ Instance.

SQLData2.png

 

Step 2)  Double click the new SQLData object in order to configure it. In this example I have called the object SQLData_Joe

SQLData3.png

 

Step 3)  Under the Database tab, choose the connection settings and select the Database and table that you wish to use. In this example, the database is SQLDATATEST and the table is dbo.Table_1. After configuring this, click the Test Connection button to ensure proper SQL Server connectivity.

SQLData4.png

 

Step 4)  Click the design tab and then click the “Get from database” button in order to retrieve the columns from the existing database.

SQLData5.png

 

Step 5)  Click the DataSheet Tab and click the Refresh button to retrieve the available records from the chosen table.

 

SQLData6.png

 

Step 6)  Save and Close the object and then deploy it 

SQLData7.png

 

Step 7)  Open the Object in Object Viewer and you will see an entry for each column from the database with tmp in front of it. In this example, I have tmpage, tmpgender, and tmpname. I also added them to the watch list to make them easier to see.

SQLData8.png

 

The database record can now be modified or updated from object viewer.

 

 

SQLData9.png

 

If you wish to access the next or previous record of delete a record you can set the RecordSelectNextCmd, RecordSelectPreviousCmd, and RecordDeleteCmd fields to true as below respectively:

 

SQLData10.png