If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Using SQLConnect() with DB2 results in CLI0199E Invalid connection string attribute

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-20-09, 11:15
cpmjones cpmjones is offline
Registered User
 
Join Date: Feb 2009
Posts: 1
Using SQLConnect() with DB2 results in CLI0199E Invalid connection string attribute

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On