Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is it possible to run an Oracle PL\Sql procedure within Excel? | Excel Discussion (Misc queries) | |||
Excel VBA against Oracle | Excel Discussion (Misc queries) | |||
Newbie : Oracle Data to Excel | Excel Programming | |||
Newbie : Sum Cells Part 2 | Excel Programming | |||
Oracle data to excel | Excel Programming |