UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Connection to Oracle DB in VBA    
 
   
motopsycho
post Nov 8 2006, 02:11 PM
Post #1

UtterAccess Addict
Posts: 190
From: Ontario, Canada



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
Go to the top of the page
 
+
KingMartin
post Nov 8 2006, 02:32 PM
Post #2

Retired Moderator
Posts: 10,959
From: Prague,CZ / Kiev,UA



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
Go to the top of the page
 
+
motopsycho
post Nov 8 2006, 03:22 PM
Post #3

UtterAccess Addict
Posts: 190
From: Ontario, Canada



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.
Go to the top of the page
 
+
KingMartin
post Nov 8 2006, 03:59 PM
Post #4

Retired Moderator
Posts: 10,959
From: Prague,CZ / Kiev,UA



No, I think the coding is correct, but obviously the environment has changed (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif)

Martin
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 02:53 PM