# Connect

The CONNECT statement is used to define Qlik Sense access to a general database through the OLE DB/ODBC interface. For ODBC, the data source first needs to be specified using the ODBC administrator.

Information noteThis functionality is not available in Qlik Sense SaaS.

Information noteThis statement supports only folder data connections in standard mode. See [File system access restriction](https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/LoadData/file-system-access-restriction.htm)

Syntax:

ODBC CONNECT TO connect-string

OLEDB CONNECT TO connect-string

CUSTOM CONNECT TO connect-string

LIB CONNECT TO connection

Arguments:

Arguments

| Argument | Description |
| --- | --- |
| connect-string | `connect-string ::= datasourcename<br>{ ;<br>conn-spec-item }`<br><br>The connection string is the data source name and an optional list of<br>one or more connection specification items. If the data source name contains<br>blanks, or if any connection specification items are listed, the connection<br>string must be enclosed by quotation marks.<br><br>datasourcename must be a defined<br>ODBC data source or a string that defines an OLE DB provider.<br><br><br>`conn-spec-item ::=`DBQ=`database_specifier \|`DriverID=`driver_specifier \|`UID=`userid \|`PWD=`password`<br><br>The possible connection specification items may differ between different<br>databases. For some databases, also other items than the above are possible.<br>For OLE DB, some of the connection specific items are mandatory and not optional. |
| connection | The name of a data connection stored in the data load editor. |

If the ODBC is placed before CONNECT, the ODBC interface will be used; else, OLE DB will be used.

Using LIB CONNECT TO connects to a database using a stored data connection that was created in the data load editor.

Example 1:

` ODBC CONNECT 
 TO 'Sales  ` `DBQ=C:\Program 
 Files\Access\Samples\Sales.mdb';`

The data source defined through this statement is used by subsequent Select (SQL) statements, until a new CONNECT statement is made.

Example 2:

`LIB CONNECT TO 'DataConnection';`

### Connect32

This statement is used the same way as the CONNECT statement, but forces a 64-bit system to use a 32-bit ODBC/OLE DB provider. Not applicable for custom connect.

### Connect64

This statement is used the same way as the as the CONNECT statement, but forces use of a 64-bit provider. Not applicable for custom connect.

## Learn more

* [ODBC](https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/DataSource/ODBC.htm)
* [OLE DB](https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/DataSource/OLEDB.htm)
* [To](https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptControlStatements/To.htm)