10. Understanding ODBC Connectivity : ODBC Programming : ODBC User Authentication : DBMS Passwords
 
Share this page                  
DBMS Passwords
DBMS passwords are extra passwords defined for Ingres users and maintained in the Ingres database. When an Ingres user account is associated with a DBMS password, the correct DBMS password must be supplied as a connection parameter, otherwise the connection attempt will be rejected.
DBMS passwords in the DSN definition in odbc.ini are not supported. The ODBC Driver supports DBMS passwords only through SQLDriverConnect(), as shown in the following example:
/*
** The "dbms_pwd" connection attribute specifies the DBMS password.
*/
strcpy( connectString, "driver={Ingres};servertype=Ingres;" \
        "server=(local);database=myDB;uid=myUserName; \
        "pwd=myPassword;dbms_pwd=myDBMS_password );
 
SQLDriverConnect( hdbc,        /* Connection handle */
        0,                     /* Window handle */
        connectString,         /* Connection string */
        SQL_NTS,               /* Nll-terminated string */
        (SQLCHAR *)NULL,       /* Output connection string */
        SQL_NTS,               /* N=ull-terminated string */
        0,                     /* Length of output connect string */
        SQL_DRIVER_NOPROMPT ); /* No prompt window */