Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLConnect() results in CLI0199E Invalid connection string attribute

Status
Not open for further replies.

cpmjones

Programmer
Feb 23, 2009
1
GB
Hi,

I'm trying to connect to my DB2 database server using the core ODBC functions SQLConnect() and SQLDriverConnect.

I can connect fine from within the Microsoft ODBC Administrator but not when using these functions.

The message I get back is

08001 IBMCLI Driver CLI0199E Invalid connection string attribute. SQLSTATE=08001 (-99999)

I am using the following code:

connectionString = "DSN=" & serverDSN & ";UID=" & user & ";PWD=" & password & ";"
iReturn = SQLDriverConnect(hDBC, 0, connectionString, Len(connectionString), strOut, Len(strOut), Cbout, SQL_DRIVER_COMPLETE)


or just

iReturn = SQLConnect(hDBC, serverDSN, SQL_NTS, user, SQL_NTS, password, SQL_NTS)

I can connect if I don't use an ODBC DSN with the following connection string:

connectionString = "Driver={" & odbcDriver & "};Database=" & dbAlias & ";Hostname=" & serverName & ";Port=" & port & ";Protocol=TCPIP;Uid=" & user & ";Pwd=" & password & ";"

However I would prefer to use the DSN rather that store all these additional data

Any ideas?

Thanks in advance,

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top