Back to Aurora Vision Library website

You are here: Start » Function Reference » Hardware Support » MSSQL » MSSQL_Read

MSSQL_Read


Header: ThirdPartySdk.h
Namespace: avl
Module: ThirdParty

Reads a value from the database.

Syntax

void avl::MSSQL_Read
(
	MSSQL_State& ioState,
	const atl::String& inConnectionString,
	const atl::String& inTableName,
	const atl::String& inColumnName,
	const atl::String& inQueriedColumn,
	const atl::String& inQueryValue,
	bool inIncludeColumnTitles,
	atl::Array<atl::Array<atl::String>>& outReadData
)

Parameters

Name Type Default Description
Input will be modified ioState MSSQL_State& Object used to maintain state of the function.
Input value inConnectionString const String& Connection string.
Input value inTableName const String& Name of the table to access.
Input value inColumnName const String& Which column will be checked.
Input value inQueriedColumn const String& Column name to compare.
Input value inQueryValue const String& Value to compare.
Input value inIncludeColumnTitles bool False Whether or not to include column names in the output data.
Output value outReadData Array<Array<String>>& Data read as strings.

Remarks

SQL database driver software

This filter is intended to cooperate with Microsoft SQL Server database. To be able to open a connection to the database, it is required to install Microsoft ODBC Driver for SQL Server.

Add DLL path to system environment variable may be required.

Recommended ODBC Driver version for Aurora Vision Studio usage is 18.

Microsoft ODBC Driver for SQL Server can be downloaded from the following website: https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server.

Connecting to a database

inConnectionString field must be used to enter a connection string that specifies information about a data source and the means of connecting to it. inConnectionString can be set to:

  • DSN=<DSN_name>
    where DSN_name is a name of a User or System DSN configured using the Microsoft ODBC Data Source Administrator tool
  • FILEDSN=<DSN_file_path>
    where DSN_file_path is a path to a .dsn file created using the Microsoft ODBC Data Source Administrator tool
  • any other valid connection string, e.g.
    Driver={ODBC Driver 18 for SQL Server};Server=myServerAddress;Database=myDataBase;UID=myUsername;PWD=myPassword;

For more information about connection strings, see: https://www.connectionstrings.com/sql-server/.

See Also