ODBCDatasource Property

General info

Label

Datasource Name

Tooltip

The name of the ODBC datasource, which can be a DSN or a valid ODBC connection string (example: "driver=\{SQL Server Native Client 11.0\}; server=someserver;uid=someuser;pwd=somepassword;"). The parameters of the connection string are defined by the used driver, which is identified by the DRIVER parameter. More information can be found here https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqldriverconnect-function and https://www.connectionstrings.com

Data type

String

Type

Regular

Code

2542

Symbolic name

MODEL_PROP_ODBCDATASOURCE

Available since

1.30.6.4266

Attributes

Name Tooltip
PROP_CONFIGURABLE The property is configurable and can be changed with DataStudio and the various inmation APIs
PROP_VISIBLE The property is visible in DataStudio and can be read by the inmation APIs

Examples

Read from or write to the ODBCDatasource property.

  • Lua

  • C#

-- Read from the ODBCDatasource
inmation.getvalue("/System/Core/obj.BatchRecord.BatchODBCConnection.ODBCDatasource")

-- Write to the ODBCDatasource
inmation.setvalue("/System/Core/obj.BatchRecord.BatchODBCConnection.ODBCDatasource", "new value")
string path = "/System/Core/obj.BatchRecord.BatchODBCConnection.ODBCDatasource";
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "so", Password = "inmation" };
StatelessInterface sli = new StatelessInterface(tcpcfg);

// Read from the ODBCDatasource
Result result = sli.ReadValue(sc, new ReadItem(path));
// Write to the ODBCDatasource
Result result = sli.WriteValue(sc, new WriteItem("new value", path));