tags:

views:

1537

answers:

2

I have a legacy VB6 application which I've inherited. The issue I'm facing is that I'm getting the infamous

ORA-12638: Credential retrieval failed

error message whenever it tries to connect to one of our Oracle databases. I can connect fine from SQLPlus and Toad, however. I've Googled around and everyone seems to say that modifying their sqlnet.ora file to

SQLNET.AUTHENTICATION_SERVICES=(NONE)

did the trick. I have yet to find anyone with an alternative fix. Here is what my connection string looks like:

"PROVIDER=OraOLEDB.Oracle;DATA SOURCE=(DESCRIPTION = " & _
"(ADDRESS = (PROTOCOL = TCP)(HOST = server1)
(PORT = 1521))" & _
"(ADDRESS = (PROTOCOL = TCP)(HOST = server2)
(PORT = 1521))" & _
"(LOAD_BALANCE = yes) " & _
"(CONNECT_DATA = " & _
"(SERVER = DEDICATED) " & _
"(SERVICE_NAME = database_name_here) " & _
") " & _
"); " & _
"User Id=username_here;Password=password_here;"

As for my VB code, it's quite simple.

Private oracleDatabaseConnection As ADODB.Connection

Set oracleDatabaseConnection = New ADODB.Connection
oracleDatabaseConnection.Open oracleConnectionString

Anyone have any ideas?

Thank you. :)

+2  A: 

Honestly this is one of those errors that can be caused by lots of different root problems.

On the assumption your database server is Windows, check its event log, both System and Application. You may find something there that is useful.

I have encountered this error in some cases because the account under which the Oracle service was running got locked.

I have also encountered it in cases where we never found the explanation, but we were always able to clear up the issue by having the user lock and unlock their PC.

Is the VB application running on a different machine than the client that can connect? If so, is it possible to test using a different client program on the same machine -- or is it possible to try the VB application on your machine?

Dave Costa
+1  A: 

If you are running a web app under IIS, restarting IIS seem to help. But this is one sucker of an issue that has not much reasoning behind.