Link to home
Start Free TrialLog in
Avatar of sebastianlink
sebastianlink

asked on

How to avoid oracle ODBC Driver Connect Popup when connecting to Oracle Database from MS Access

My MS Access application connects to Oracle using ODBC  and a user specific generated password. That is, the user enters the password in the MS Access form. The password is transformed by a function to a user specific DBPassword in the access application.
Using this DBPassword, a connection to the oracle database is made using the following function.

The problem is: If the user enters the wrong password, the function ConnectToODBC fails connecting and shows a popup screen of the ODBC driver - see attached file.

The question is: I don't want this screen to pop up.

I've been searching for hours for a solution and would if anybody could help me.

Public Function ConnectToODBC(ByVal DBUser As String, ByVal DBPassword As String) As Integer
Dim wrkTemp As Workspace
Dim dbRemote As Database
Dim odbc_con As String
Set wrkTemp = DBEngine.Workspaces(0)
Set dbRemote = wrkTemp.OpenDatabase("ORACLE_DATABASE_SID", dbDriverComplete, False, "ODBC;DSN=ORACLE_DATABASE_DSN;UID=" & DBUser & ";PWD=""" & DBPassword & """")
odbc_con = dbRemote.Connect
dbRemote.Close
End Function

Open in new window

OracleDriverPopupMessage.doc
Avatar of als315
als315
Flag of Russian Federation image

I think your problem is in double quotes. Try to remove them:
... PWD=" & DBPassword
Avatar of sebastianlink
sebastianlink

ASKER

Thanks for the response.
The quotes are not the problem since everything works fine if the password is correct.
The popup appears only if a wrong password is sent to the Oracle driver - anad that is my problem.
ASKER CERTIFIED SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the great help.
My customer will be very happy.