10. Understanding ODBC Connectivity : ODBC Programming : ODBC User Authentication : Installation Passwords
 
Share this page                  
Installation Passwords
SQLConnect() and SQLDriverConnect() can be used with installation passwords. The following code example demonstrates the use of installation passwords with SQLDriverConnect(). Note that the user name and password are not specified.
strcpy( connectString, "driver={Ingres};servertype=Ingres;" \
        "server=vnodeDef;database=remoteDB" );
    
SQLDriverConnect( hdbc,        /* Connection handle */
        0,                     /* Window handle */
        connectString,         /* Connection string */
        SQL_NTS,               /* This is a null-terminated string */
        (SQLCHAR *)NULL,       /* Output (result) connection string */
        SQL_NTS,               /* This is a null-terminated string */
        0,                     /* Length of output connect string */
        SQL_DRIVER_NOPROMPT ); /* Don't display a prompt window */
If the ODBC application executes in the local "ingres" account, the target Name Server authenticates "ingres" using the installation password for the target database. You cannot use installation passwords for a local database unless the connection is done through a vnode definition.
The Ingres super user concept applies to installation passwords. Ingres super users can specify alternate user names, but do not need to supply passwords, as shown in the following SQLConnect() example:
SQLConnect( hdbc,                 /* Connection handle */
        (SQLCHAR *)"myDSN",       /* The ODBC DSN definition */
        SQL_NTS,                  /* This is a null-terminated string */
        (SQLCHAR *)"altUserName", /* Alternate username */
        SQL_NTS,                  /* This is a null-terminated string */
        (SQLCHAR *)NULL,          /* No password required */
        SQL_NTS );                /* This is a null-terminated string */
The example above assumes "myDSN" references a vnode definition.