# ConnectString Script function

The ConnectString() function returns the name of the active data connection for ODBC or OLE DB connections. The function returns an empty string if no connect statement has been executed, or after a disconnect statement.

Syntax:

ConnectString()

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/FileFunctions/ConnectString.htm)

#### Examples and results:

Scripting examples

| Example | Result |
| --- | --- |
| `LIB CONNECT TO 'Tutorial ODBC';<br>`<br>`<br>ConnectString:<br>`<br>`Load ConnectString() as ConnectString AutoGenerate 1;` | Returns<br>'Tutorial ODBC' in field ConnectString.<br><br>This example assumes that you have an available data connection called Tutorial ODBC. |