I\'m using the following:
DRIVER={Vertica ODBC Driver 4.1};
SERVER=lnxtabdb01.xxxx.com;
PORT=5433;
DATABASE=vertica;
USER=dbadmin;
PASSWORD=vertica;
OPTION=3
The accepted answer describes a way to connect with the Vertica ODBC driver
using a System DSN
. It is possible to connect using just a connection string to directly configure the connection against the driver. The following connection string pattern has been tested against the Vertica ODBC Client Driver v6.1.2
:
Driver=Vertica;Server=MyVerticaServer;Port=5433;Database=MyVerticaDB;UID=foo;PWD=bar
Port is optional:
Driver=Vertica;Server=MyVerticaServer;Database=MyVerticaDB;UID=foo;PWD=bar
Or, if you're doing this in .NET as I am, you can use this to format up the connection string from the necessary parameters:
var connectionString = string.Format(
"Driver=Vertica;Server={0};{1}Database={2};UID={3};PWD={4}",
server,
port == null ? string.Empty : string.Format("Port={0};", port),
database,
username,
password);