Connection Strings

A connection string is a set of connection parameters that tell WinSQL Professional how to connect to a remote database. If you want to use a connection string for connecting to a database, or if your application requires it, you must specify a DSN (data source name), a File DSN, or a DSN-less connection in the string. The difference is whether you use the DSN=, FILEDSN=, or the DRIVER= keyword in the connection string, as described in the ODBC specification. A DSN or FILEDSN connection string tells the driver where to find the default connection information. Optionally, you may specify attribute=value pairs in the connection string to override the default values stored in the data source.

To use a connection string rather than a DSN connection, select the Connection String tab. The following window displays:

 

 

Choose one of the following connection string types and use the accompanying format as an example for creating your entry:

·DSN connection, which uses the following format:

DSN=data_source_name[;attribute=value[;attribute=value]...]

·File DSN connection, which uses the following format:

FILEDSN=filename.dsn[;attribute=value[;attribute=value]...]

·DSN-less connection, which uses a specific driver instead of a data source, and uses the following format:

DRIVER=[{]driver_name[}][;attribute=value[;attribute=value]...]

If you are unsure about what to enter here, delete everything from the text box and click OK. The ODBC Driver manager window will display, and you can select the data source to which you wish to connect. WinSQL Professional captures the connection string that is used by the ODBC Driver manager and saves it for future use. The next time you establish connection, this text box will be completed for you.

When using a Connection String, you must also specify a Friendly Name, which can be any arbitrary value. WinSQL uses this name to uniquely identify a connection. Users can choose a previously-entered connection string by selecting the desired value from the Friendly Name dropdown list.