diff --git a/doc/backends/odbc.html b/doc/backends/odbc.html index 33f38b124..12dcf4e53 100644 --- a/doc/backends/odbc.html +++ b/doc/backends/odbc.html @@ -274,7 +274,13 @@

get_connection_string()

Configuration options

-

None

+

This backend supports odbc_option_driver_complete option which can be passed to it via connection_parameters class. The value of this option is passed to SQLDriverConnect() function as "driver completion" parameter and so must be one of SQL_DRIVER_XXX values, in the string form. The default value of this option is SQL_DRIVER_PROMPT meaning that the driver will query the user for the user name and/or the password if they are not stored together with the connection. If this is undesirable for some reason, you can use SQL_DRIVER_NOPROMPT value for this option to suppress showing the message box:

+ +
+connection_parameters parameters("odbc", "DSN=mydb");
+parameters.set_option(odbc_option_driver_complete, "0" /* SQL_DRIVER_NOPROMPT */);
+session sql(parameters);
+
diff --git a/doc/connections.html b/doc/connections.html index 9e02b3a27..d12167296 100644 --- a/doc/connections.html +++ b/doc/connections.html @@ -54,6 +54,14 @@

Connecting to the database

The last two constructors described above try to locate the shared library with the name libsoci_ABC.so (or libsoci_ABC.dll on Windows), where ABC is the backend name. In the above examples, the expected library name will be libsoci_postgresql.so for Unix-like systems.

+

The most general form of the constructor takes a single object of connection_parameters type which contains a pointer to the backend to use, the connection string and also any connection options. Using this constructor is the only way to pass any non-default options to the backend. For example, to suppress any interactive prompts when using ODBC backend you could do:

+
+connection_parameters parameters("odbc", "DSN=mydb");
+parameters.set_option(odbc_option_driver_complete, "0" /* SQL_DRIVER_NOPROMPT */);
+session sql(parameters);
+
+Notice that you need to #include <soci-odbc.h> to obtain the option name declaration. The existing options are described in the backend-specific part of the documentation. +

Environment configuration:

The SOCI_BACKENDS_PATH environment variable defines the set of paths where the shared libraries will be searched for. There can be many paths, separated by colons, and they are used from left to right until the library with the appropriate name is found. If this variable is not set or is empty, the current directory is used as a default path for dynamically loaded backends.

@@ -86,6 +94,10 @@

Connecting to the database

// or: sql.open("postgresql://dbname=mydb"); + +// or also: +connection_parameters parameters("postgresql", "dbname=mydb"); +sql.open(parameters);

The rules for backend naming are the same as with the constructors described above.

diff --git a/doc/errors.html b/doc/errors.html index ed59640de..5c147af53 100644 --- a/doc/errors.html +++ b/doc/errors.html @@ -118,7 +118,7 @@

Errors

Previous (Installation) - Next (Connections and simple queries) + Next (Connections and simple queries) diff --git a/doc/reference.html b/doc/reference.html index 05b406293..d265f75e2 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -14,6 +14,7 @@

Client interface reference