Unwanted / unnecessary prompt connecting to DB

R

Richard Clarke

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
 
J

John Harrison

Richard Clarke said:
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
john
 
B

Bob Hairgrove

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().
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top