WinSQL » Knowledge base

Document information

Document ID: 815
Subject: Using ODBC connection string to establish connection
Creation date: 7/29/09 4:48 PM
Last modified on: 7/29/09 4:48 PM


Details


A connection string is a set of connection parameters that tell WinSQL 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.

Beginning with ODBC Administrator version 4.0, a DSN is not required to establish a database connection. To use a connection string rather than a DSN connection, click the Specify connection string check box. The following window is displayed:

Connection string

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.




Add a comment to this document

Do you have a helpful tip related to this document that you'd like to share with other users?

Important: This area is reserved for useful tips. Therefore, do not post any questions here. Instead, use our public forums to post questions.

Navigation

Social Media

Powered by 10MinutesWeb.com