Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 10th, 2009, 12:24 PM
Registered User
 
Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Rewrite code from DAO to ADO To Establish Oracle Connection

Within an Access 2007 .mdb, I need to establish a connection to an Oracle 10
table in order to update that table. I'm not able to establish that
connection. Here is the code below:

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim cmd As ADODB.Command

Set cn = New ADODB.Connection
Set cmd = New ADODB.Command
Set rs = New ADODB.Recordset

cn = "Provider='msdaora';Data Source='ACIIS';User
Id='ACIIS_ADMIN';Password='xxxxxxxx';"
cn.Open


Receive following error message:
Unrecoverable error
:Provider cannot be found. It may not be properly installed. [3706]

I get the same error message when I replace the connection string code to the Oracle driver:

cn.Provider = "Driver='OraOLEDB';Data Source='ACIIS';User
Id='ACIIS_ADMIN';Password='aciis8adm';"


Help
Pierre
 
Old August 10th, 2009, 01:52 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You need to have the Oracle client software installed on your computer, and you need to do something like this:

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim cmd As ADODB.Command
Dim sCN As String

Set cn = New ADODB.Connection
Set cmd = New ADODB.Command
Set rs = New ADODB.Recordset

sCN = "Provider='msdaora';Data Source='ACIIS';User
Id='ACIIS_ADMIN';Password='xxxxxxxx';"

cn.Open sCN
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using DAO and ADO within ADODB.connection faridrd Access VBA 0 January 8th, 2008 10:43 PM
how to convert this DAO connection code to ADO Con ruth26 VB Databases Basics 0 May 11th, 2006 05:15 AM
how to translate a code in DAO to ADO itsmenow Access VBA 2 July 7th, 2005 09:19 AM
Convert ADO connection to DAO database dr_morose Access VBA 0 November 17th, 2004 05:44 PM
converting DAO code to ADO Khalifeh Access 25 November 4th, 2003 01:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.