This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Creating an ODBC DSN for windows clients

To create a DSN for Microsoft Windows clients, you must perform the following tasks:.

To create a DSN for Microsoft Windows clients, you must perform the following tasks:

1 - Setting up an ODBC DSN

A Data Source Name (DSN) is the ODBC logical name for the drive and other information the database needs to access data.

A Data Source Name (DSN) is the ODBC logical name for the drive and other information the database needs to access data. The name is used by Internet Information Services (IIS) for a connection to an ODBC data source.

This section describes how to use the Vertica ODBC Driver to set up an ODBC DSN. This topic assumes that the driver is already installed, as described in Installing Client Drivers on Windows.

To set up a DSN

  1. Open the ODBC Administrator. For example, you could navigate to Start > Control Panel > Administrative Tools > Data Sources (ODBC).

  2. Decide if you want all users on your client system to be able to access to the DSN for the Vertica database.

    • If you want all users to have access, then click the System DSN tab.

    • Otherwise, click the User DSN tab to create a DSN that is only usable by your Windows user account.

  3. Click Add to create a new DSN to connect to the Vertica database.

  4. Scroll through the list of drivers in the Create a New Data Source dialog box to locate the Vertica driver. Select the driver, and then click Finish.

    The Vertica ODBC DSN configuration dialog box appears.

  5. Click the More >>> button to view a description of the field you are editing and the connection string defined by the DSN.

  6. Enter the information for your DSN. The following fields are required:

    • DSN Name — The name for the DSN. Clients use this name to identify the DSN to which they want to connect. The DSN name must satisfy the following requirements:

      • Its maximum length is 32 characters.

      • It is composed of ASCII characters except for the following: { } , ; ? * = ! @ \

      • It contains no spaces.

    • Server — The host name or IP address of the Vertica server to which you want to connect. Use localhost, if Vertica is installed on the same machine.

      You can provide an IPv4 address, IPv6 address, or host name.

      In mixed IPv4/IPv6 networks, the DNS server configuration determines which IP version address is sent first. Use the PreferredAddressFamily option to force the connection to use either IPv4 or IPv6.

      The PreferredAddressFamily option is available on the Client Settings tab.

    • Backup Servers — A comma-separated list of host names or IP addresses used to connect to if the server specified by the Server field is down. Optional.

    • Database —The name of the Vertica database.

    • User Name — The name of the user account to use when connecting to the database. If the application does not supply its own user name when connecting to the DSN, this account name is used to log into the database.

    The rest of the fields are optional. See DSN Parameters for detailed information about the DSN parameters you can define.

  7. If you want to test your connection:

    1. Enter at least a valid DSN name, Server name, Database, and either User name or select Windows authentication.

    2. If you have not selected Windows authentication, you can enter a password in the Password box. Alternately, you can select Password for missing password to have the driver prompt you for a password when connecting.

    3. Click Test Connection.

  8. When you have finished editing and testing the DSN, click OK. The Vertica ODBC DSN configuration window closes, and your new DSN is listed in the ODBC Data Source Administrator window.

  9. Click OK to close the ODBC Data Source Administrator.

After creating the DSN, you can test it using Microsoft Excel 2007.

Setting up a 32-Bit DSN on 64-Bit versions of Microsoft windows

On 64-bit versions of Windows, the default ODBC Data Source Administrator creates and edits DSNs that are associated with the 64-bit Vertica ODBC library.

Attempting to use these 64-bit DSNs with a 32-bit client application results in an architecture mismatch error. Instead, you must create a specific 32-bit DSN for 32-bit clients by running the 32-bit ODBC Administrator usually located at:

c:\Windows\SysWOW64\odbcad32.exe

This administrator window edits a set of DSNs that are associated with the 32-bit ODBC library. You can then use your 32-bit client applications with the DSNs you create with this version of the ODBC administrator.

2 - Encrypting passwords on ODBC DSN

When you install an ODBC driver and create a Data Source Name (DSN) the DSN settings are stored in the registry, including the password.

When you install an ODBC driver and create a Data Source Name (DSN) the DSN settings are stored in the registry, including the password. Encrypting passwords on ODBC DSN applies only to Windows systems.

Encrypting passwords on an ODBC data source name (DSN) provides security against unauthorized database access. The password is not encrypted by default and is stored in plain-text.

Enable password encryption

Use the EncryptPassword parameter to enable or disable password encryption for an ODBC DSN:

  • EncryptPassword = true enables password encryption

  • EncryptPassword = false (default) disables password encryption

Set EncryptPassword in the Windows registry - HKEY_LOCAL_MACHINE > Software > Vertica > ODBC > Driver EncryptPassword=<true/false>.

Encrypted passwords get updated in the following registry locations:

For a user DSN:

HKEY_CURRENT_USER-> Software -> ODBC -> ODBC.INI -> DSNNAME -> PWD

For a system DSN:

HKEY_LOCAL_MACHINE-> Software -> ODBC -> ODBC.INI -> DSNNAME -> PWD

Verify password encryption

Use Windows Registry editor to determine if password encryption is enabled based on the value of EncryptPassword. Depending on the type of DSN you installed, check the following:

For a user DSN: HKEY_CURRENT_USER > Software > ODBC > ODBC.INI > dsn name > isPasswordEncrypted=<1/0>

For a system DSN: HKEY_LOCAL_MACHINE > Software > ODBC > ODBC.INI > dsn name > isPasswordEncrypted=<1/0>

For each DSN, the value of the isPasswordEncrypted parameter indicates the status of the password encryption, where 1 indicates an encrypted password and 0 indicates an unencrypted password.

3 - Testing an ODBC DSN using Excel

You can use Microsoft Excel to verify that an application can connect to an ODBC data source or other ODBC application.

You can use Microsoft Excel to verify that an application can connect to an ODBC data source or other ODBC application.

  1. Open Microsoft Excel, and select Data > Get External Data > From Other Sources > From Microsoft Query.

  2. When the Choose Data Source dialog box opens:

    1. Select New Data Source, and click OK.

    2. Enter the name of the data source.

    3. Select the Vertica driver.

    4. Click Connect.

  3. When the Vertica Connection Dialog box opens, enter the connection information for the DSN, and click OK.

  4. Click OK on the Create New Data Source dialog box to return to the Choose Data Source dialog box.

  5. Select VMart_Schema*, and verify that the Use the Query Wizard check box is deselected. Click OK.

  6. When the Add Tables dialog box opens, click Close.

  7. When the Microsoft Query window opens, click the SQL button.

  8. In the SQL window, write any simple query to test your connection. For example:

    SELECT DISTINCT calendar_year FROM date_dimension;
    
  9. * If you see the caution, "SQL Query can't be represented graphically. Continue anyway?" click **OK**.      * The data values 2003, 2004, 2005, 2006, 2007 indicate that you successfully connected to and ran a query through ODBC.
    
  10. Select File > Return Data to Microsoft Office Excel.

  11. In the Import Data dialog box, click OK.

    The data is now available for use in an Excel worksheet.