Connect to Oracle 10g - fails

D

D

Hi:

Could you please tell me what is wrong with the below?

Thank you,

Dan

***

Function OracleConnect() As Boolean

Dim ws As Workspace
Dim db As Database
Dim LConnect As String

On Error GoTo Err_Execute


LConnect = "ODBC; DSN=x;Service Name=x;UID=x;PWD=x"

'Point to the current workspace
Set ws = DBEngine.Workspaces(0)

'Connect to Oracle
Set db = ws.OpenDatabase("", False, True, LConnect)

db.Close

OracleConnect = True

Exit Function

Err_Execute:
MsgBox "Connecting to Oracle failed."
OracleConnect = False

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top