LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default PivotTable from a ADODB.Recordset ?

Hi.

I've been working with building PivotTables, in vb code, form external
Oracle sources.

I have it working, one way (the xlExternal data source, with the appropriate
..Connection property). But, the way that it is working still requires the
tnsnams.ora file to define what "DEV4" (the name of the database instance)
might mean, etc.

The other day, I was looking on the web and found an article about building
the connect string right into the code, eliminating the need for the
tnsnames.ora file.

The relevant code, minus the database username and password, is he
<<<<<<<<<<<<<<
Dim strCon As String

strCon = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=HOSTLOC)(PORT=1526))" & _
"(CONNECT_DATA=(SID=DEV4))); uid=USER; pwd=PASS;"

Dim oCon As Object
Set oCon = CreateObject("ADODB.Connection")

Dim oRs As Object
Set oRs = CreateObject("ADODB.Recordset")

oCon.Open strCon

Set oRs = oCon.Execute("SELECT * from xxaai_test_lab_forecast")
<<<<<<<<<<<<<<<<<<

That works fine, and I can then go through and put that data into a
spreadsheet, should I happen to want to, which I don't.

But, I would like to know how to put that recordset into a pivot table,
somewhat directly.

Can anyone suggest a way to do that?

Thanks,
Mark
 
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
Using ADODB.Recordset Dan Thorman Excel Programming 7 February 7th 07 01:24 AM
ADODB.RecordSet Dan Thorman Excel Programming 6 January 30th 07 05:11 PM
0 with ADODB Recordset Stefen Percoco Excel Programming 1 July 8th 04 09:54 PM
adodb.recordset with excel nate axtell Excel Programming 14 June 11th 04 01:32 PM
ADODB Recordset Seth[_3_] Excel Programming 0 August 5th 03 02:15 PM


All times are GMT +1. The time now is 04:25 AM.

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"