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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 6 failed to connect Oracle 9i, HELP!!

Status
Not open for further replies.

dumdumdum

Programmer
Aug 27, 2003
3
HK
Hi all,

I encountered problem when using VB 6 with Oracle 9i, can anyone give me some ideas how to solve it? or any other good methods? Many thx...

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Set conn = New ADODB.Connection
conn.CursorLocation = adUseClient
conn.ConnectionString = "DRIVER={Microsoft ODBC for Oracle};" _
& "SERVER=xxx;" _
& "DATABASE=xxx;" _
& "UID=xxx;" _
& "PWD=xxx;" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 163841
conn.Open

Error : [Microsoft][ODBC Driver Manager]Driver's SQLSetConnectAttr failed

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Set conn = New ADODB.Connection
conn.CursorLocation = adUseClient
conn.ConnectionString = "DRIVER={Oracle in OraHome92};" _
& "SERVER=xxx;" _
& "DATABASE=xxx;" _
& "UID=xxx;" _
& "PWD=xxx;" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 163841
conn.Open

Error : [Oracle][ODBC][Ora]ORA-12560: TNS: protocol adapter error

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I wonder is there any problem about the "DRIVER" or Oracle setup problem?

Best Regard,
dumdum
 
I'm not that familiar with Oracle, but usually when you have a set of Flag settings you would 'OR' them rather than adding them. You might try:
& "OPTION=" & 1 OR 2 OR 8 OR 32 OR 2048 OR 163841

By adding, you haven't set the '1' flag or the '2' flag, but you have inadvertently set the '4' flag, because the odd 1 from 162841 is being added rather than OR'd

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Are u sure that Oracle (OraSID and OraTNSListener) Services are up and running properly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top