Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Oralce Connection

I am trying to translate the code generated by the macro recorder to straight
vb code where i can caret and manage the code my self. I know that I have
an Oracle driver installed.

Anyway I am not sure what type of a provider I should be using, I persume
something which would say Oracle, but I do not see that generated in the
code. Here is what was generated.

With ActiveSheet.QueryTables.Add(Connection:=Array(Arra y( _

"ODBC;DSN=PRG_OPS;UID=YYYYYYYY;PWD=XXXXXXX;DBQ=EDS SP.WORLD;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL= 10;LOB=T;RST=T;GDE=F;FRL=F;BAM

When I attempt to write the code like the following:

Dim cnn As New ADODB.Connection
Dim strCnn As String
Dim iTry As Integer

strCnn = "Provider=OraOLEDB.Oracle.1;Password=operations;Us er
ID=PRG_OPS;Data Server=EDSSP.WORLD;Persist Security Info=True"

The compiler stops on the Dim Statement (New ADODB.Connection). Why does it
not recognize this?

Am I using the provider?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Oralce Connection

You must add a reference to the ADO object library (or use late binding).

To add a reference go to Tools References

To use late binding:

Dim cnn As Object
set cnn = createobject("ADODB.Connection")

Tim


"Jim Heavey" wrote in message
...
I am trying to translate the code generated by the macro recorder to
straight
vb code where i can caret and manage the code my self. I know that I have
an Oracle driver installed.

Anyway I am not sure what type of a provider I should be using, I persume
something which would say Oracle, but I do not see that generated in the
code. Here is what was generated.

With ActiveSheet.QueryTables.Add(Connection:=Array(Arra y( _

"ODBC;DSN=PRG_OPS;UID=YYYYYYYY;PWD=XXXXXXX;DBQ=EDS SP.WORLD;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL= 10;LOB=T;RST=T;GDE=F;FRL=F;BAM

When I attempt to write the code like the following:

Dim cnn As New ADODB.Connection
Dim strCnn As String
Dim iTry As Integer

strCnn = "Provider=OraOLEDB.Oracle.1;Password=operations;Us er
ID=PRG_OPS;Data Server=EDSSP.WORLD;Persist Security Info=True"

The compiler stops on the Dim Statement (New ADODB.Connection). Why does
it
not recognize this?

Am I using the provider?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
always recheck data connection library for latest connection strin FurmanGG Excel Discussion (Misc queries) 0 September 14th 07 04:48 PM
no DDE connection?? askmiller Excel Discussion (Misc queries) 0 August 5th 06 09:19 PM
ADO Connection Help Matty G Excel Programming 3 June 23rd 05 02:14 PM
Connection using ADO alvin Excel Programming 5 April 5th 05 07:58 AM
SQL Connection Adul Excel Programming 0 November 4th 04 08:24 AM


All times are GMT +1. The time now is 09:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"