Full Version: Connection to Oracle DB in VBA
UtterAccess Discussion Forums > Microsoft® Office > Microsoft Excel
motopsycho
This was originally written in Excel 2000 and now we are upgrading to XP. Code is erroring out in XP on this line "Set OraSession = CreateObject("OracleInProcServer.XOraSession")". Any suggestions?

Public AppDirec As String 'application directory
Public OraSession As Object
Public OraDatabase As Object

Sub OpenOracleDatabase_SFRDW()
Dim tmpx As String
On Error GoTo ErrorHandler
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDataBase("SFRDW", "UserID/PassWord", 0&)
Exit Sub
ErrorHandler:
tmpx = MsgBox("Error gaining connection", , "Oracle Connection Error")
OraError = True
Close
End
End Sub
KingMartin
It seems that the Oracle Client is not installed... is it possible?

Because the line seems to be OK...

http://www.orafaq.com/faqoo4o.htm

Martin
motopsycho
Well I can connect to the DB via Toad and Oracle Discoverer. It's been a while since I have had to connect to the DB via Excel. I can also connect to the DB in Excel via the Import External Data using the New DB Query Function. That is why I thought there maybe an error in the coding.
KingMartin
No, I think the coding is correct, but obviously the environment has changed sad.gif

Martin
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.