Unwanted / unnecessary prompt connecting to DB

Discussion in 'C++' started by Richard Clarke, Oct 18, 2004.

  1. Hi

    My code is as follows:

    retcode = SQLConnect (lDBC, szDataSource, SQL_NTS, (unsigned char
    *)szUserName, SQL_NTS, (unsigned char *)szPassword, SQL_NTS);

    As I am providing the username and password I don't expect to see the
    prompt for them, but it is appearing. I am attempting to connect to an
    AS/400 database through ODBC using the IBM client access driver.

    Is there an SQLSetConnectOption
    similar to this one SQLSetConnectOption(m_hDbc, SQL_LOGIN_TIMEOUT, 5);
    that will set the prompt to off? Or is it my casting from CString to
    unsigned char * that is causing the problem?

    Many thanks

    --

    Rich (change nospam to mlu035 to reply direct)
    Richard Clarke, Oct 18, 2004
    #1
    1. Advertising

  2. "Richard Clarke" <> wrote in message
    news:...
    > Hi
    >
    > My code is as follows:
    >
    > retcode = SQLConnect (lDBC, szDataSource, SQL_NTS, (unsigned char
    > *)szUserName, SQL_NTS, (unsigned char *)szPassword, SQL_NTS);
    >
    > As I am providing the username and password I don't expect to see the
    > prompt for them, but it is appearing. I am attempting to connect to an
    > AS/400 database through ODBC using the IBM client access driver.
    >
    > Is there an SQLSetConnectOption
    > similar to this one SQLSetConnectOption(m_hDbc, SQL_LOGIN_TIMEOUT, 5);
    > that will set the prompt to off? Or is it my casting from CString to
    > unsigned char * that is causing the problem?
    >


    OK, this is a question about a SQL API, but this group is about the C++
    language. You need to take this somewhere where it is topical. A Windows
    programming group or a database programming group would seem to be better
    places.

    How about news:microsoft.public.vc.database?

    john
    John Harrison, Oct 18, 2004
    #2
    1. Advertising

  3. [OT] Re: Unwanted / unnecessary prompt connecting to DB

    On 18 Oct 2004 02:07:12 -0700, (Richard
    Clarke) wrote:

    >Hi
    >
    >My code is as follows:
    >
    >retcode = SQLConnect (lDBC, szDataSource, SQL_NTS, (unsigned char
    >*)szUserName, SQL_NTS, (unsigned char *)szPassword, SQL_NTS);
    >
    >As I am providing the username and password I don't expect to see the
    >prompt for them, but it is appearing. I am attempting to connect to an
    >AS/400 database through ODBC using the IBM client access driver.
    >
    >Is there an SQLSetConnectOption
    >similar to this one SQLSetConnectOption(m_hDbc, SQL_LOGIN_TIMEOUT, 5);
    >that will set the prompt to off? Or is it my casting from CString to
    >unsigned char * that is causing the problem?
    >


    I suggest you post this question to:

    comp.databases.ibm-db2

    Also, try using SQLDriverConnect() with the switch
    SQL_DRIVER_COMPLETE_REQUIRED or SQL_DRIVER_NOPROMPT instead of
    SQLConnect().

    --
    Bob Hairgrove
    Bob Hairgrove, Oct 18, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dominik Jain
    Replies:
    9
    Views:
    8,494
    Dominik Jain
    Aug 4, 2005
  2. Steffen Beyer
    Replies:
    3
    Views:
    747
    Richard Tobin
    Nov 2, 2004
  3. gaurav kashyap
    Replies:
    2
    Views:
    606
    gaurav kashyap
    Oct 30, 2008
  4. gaurav kashyap
    Replies:
    3
    Views:
    673
    gaurav kashyap
    Oct 31, 2008
  5. Mel
    Replies:
    10
    Views:
    3,096
    Sailaja Appi
    Feb 13, 2009
Loading...

Share This Page