Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Newbie : Oracle to Excel Part 2. RDO or ADO?


I am using Excel 2002.

Thanks for the previous reply. I wanted to do the following. I wanted
to pass an SQL statement to Oracle. For example, here is a pretend SQL
statement

Select customer id, name from customer table where state = "NY"

Then use RDO or ADO to get the data, and place it into Excel.

How should I do this. Do I still create an ODBC link? Can I still pass
SQL statements using ODBC?

Thanking you all in advance

Rich

...

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default Newbie : Oracle to Excel Part 2. RDO or ADO?

Hi Rich,

Have a try

Sub test()
Dim connMdb As ADODB.Connection
Dim recMdb As ADODB.Recordset
Dim strStatus As String

Set connMdb = New ADODB.Connection
Set recMdb = New ADODB.Recordset
"open a connection to the DB
connMdb.conn.Open "Provider=MSDAORA;Data Source=theDB", "userID", "password"
recMdb.Open "SELECT [customer id], name FROM customer WHERE state = 'NY' ;",
connMdb, adOpenForwardOnly,
adLockOptimistic
Do while recMdb.EOF = False
debug.print recmdb.fields("customer id").value & " " &
recmdb.fields("name").value
Loop
recMdb.Close
Next cl

connMdb.Close
Set recMdb = Nothing
Set connMdb = Nothing
End Sub

Regards
Jean-Yves
wrote in message
oups.com...

I am using Excel 2002.

Thanks for the previous reply. I wanted to do the following. I wanted
to pass an SQL statement to Oracle. For example, here is a pretend SQL
statement

Select customer id, name from customer table where state = "NY"

Then use RDO or ADO to get the data, and place it into Excel.

How should I do this. Do I still create an ODBC link? Can I still pass
SQL statements using ODBC?

Thanking you all in advance

Rich

..



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
Is it possible to run an Oracle PL\Sql procedure within Excel? mowee Excel Discussion (Misc queries) 0 January 22nd 10 03:04 PM
Excel VBA against Oracle Johnson Shine Excel Discussion (Misc queries) 3 January 14th 07 02:05 PM
Newbie : Oracle Data to Excel [email protected] Excel Programming 1 August 10th 05 07:34 AM
Newbie : Sum Cells Part 2 RM[_2_] Excel Programming 3 February 24th 04 06:54 AM
Oracle data to excel Kim[_8_] Excel Programming 2 October 21st 03 12:29 PM


All times are GMT +1. The time now is 11:32 PM.

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

About Us

"It's about Microsoft Excel"