Creating a Data Source Name

When connecting to your data store using a DSN, you only need to configure the odbc.ini file. Set the properties in the odbc.ini file to create a DSN that specifies the connection information for your data store. For information about configuring a DSN-less connection instead, see Configuring a DSN-less Connection.

If your machine is already configured to use an existing odbc.ini file, then update that file by adding the settings described below. Otherwise, copy the odbc.ini file from the Setup subfolder in the driver installation directory to the home directory, and then update the file as described below.

To create a Data Source Name:

  1. In a text editor, open the odbc.ini configuration file.
  2. Note:

    If you are using a hidden copy of the odbc.ini file, you can remove the period (.) from the start of the file name to make the file visible while you are editing it.

  3. In the [ODBC Data Sources] section, add a new entry by typing a name for the DSN, an equal sign (=), and then the name of the driver.
  4. For example, on a macOS machine:

    [ODBC Data Sources]

    Sample DSN=Simba Google Ads ODBC Connector

    For example, for a 32-bit driver on a Linux machine:

    [ODBC Data Sources]

    Sample DSN=Simba Google Ads ODBC Connector 32-bit

  5. Create a section that has the same name as your DSN, and then specify configuration options as key-value pairs in the section:
    1. Set the Driver property to the full path of the driver library file that matches the bitness of the application.
    2. For example, on a macOS machine:

      Driver=/Library/simba/googleadsodbc/lib/libgoogleadsodbc_sbu.dylib

      For example, for a 32-bit driver on a Linux machine:

      Driver=/opt/simba/googleadsodbc/lib/32/libgoogleadsodbc_sb32.so

    3. Set the Developer_Token property to the developer token associated the manager account that you use to grant access to the Ads API.
    4. Note:

      You can find your developer token by logging in to your Ads manager account and navigating to the Ads API Center. If you do not have a developer token or a manager account, set them up by going through the steps detailed in "Sign Up" in the Ads API documentation: https://developers.google.com/adwords/api/docs/guides/signup.

      For example:

      Developer_Token=xMb7jYlA8RpKf3SQB1K9jU

    5. Set the Client_Customer_Id property to the client customer ID that you want the driver to use by default for API requests.
    6. Note:

      The client customer ID is the ID displayed on the lowest hierarchy level in your Ads manager account.

      For example:

      Client_Customer_Id=123-456-7890

    7. Configure authentication using a Google user account or a Google service account. For more information, see Configuring Authentication.
    8. Optionally, to use trusted CA certificates from a .pem file, set the TrustCertsPath property to the full path of the file.
    9. Optionally, set additional key-value pairs as needed to specify other optional connection settings. For detailed information about all the configuration options supported by the Simba Google Ads ODBC Connector, see Connector Configuration Properties.
  6. Save the odbc.ini configuration file.
  7. Note:

    If you are storing this file in its default location in the home directory, then prefix the file name with a period (.) so that the file becomes hidden. If you are storing this file in another location, then save it as a non-hidden file (without the prefix), and make sure that the ODBCINI environment variable specifies the location. For more information, see Specifying the Locations of the Connector Configuration Files.

For example, the following is an odbc.ini configuration file for macOS containing a DSN that connects to Google Ads using a refresh token obtained from a user account:

[ODBC Data Sources]

Sample DSN=Simba Google Ads ODBC Connector

[Sample DSN]

Driver=/Library/simba/googleadsodbc/lib/libgoogleadsodbc_sbu.dylib

Developer_Token=xMb7jYlA8RpKf3SQB1K9jU

Client_Customer_Id=123-456-7890

Auth_Type=OAuth_2.0

RefreshToken=CH01pcNn/qFcYwUlJpkF_yyufYrqj4O4g7cdXvGgs-zT6

For example, the following is an odbc.ini configuration file for a 32-bit driver on a Linux machine, containing a DSN that connects to Google Ads using a refresh token obtained from a user account:

[ODBC Data Sources]

Sample DSN=Simba Google Ads ODBC Connector 32-bit

[Sample DSN]

Driver=/opt/simba/googleadsodbc/lib/32/libgoogleadsodbc_sb32.so

Developer_Token=xMb7jYlA8RpKf3SQB1K9jU

Client_Customer_Id=123-456-7890

Auth_Type=OAuth_2.0

RefreshToken=CH01pcNn/qFcYwUlJpkF_yyufYrqj4O4g7cdXvGgs-zT6

You can now use the DSN in an application to connect to the data store.