ADO and pivot tables

W

Wolfie

I've been using ODBC for external data sources to pivot tables. I would now
like to switch to using ADO. With ODBC, the code looks like:

With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal)
.Connection = Array("ODBC;DSN=MyDSN;;;;;DATABASE=MyDatabase;")
.CommandType = xlCmdSql
.CommandText = Worksheets("SQL1").Range("A100").Value
.CreatePivotTable TableDestination:="R8C1", TableName:= _
"PivotTable1"
End With

How could I do the same with ADO?

TIA,

Wolfie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top