Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Does a Pivot External Source to SQL Server stay connected?

I have a routine that passes different parameters to a database in a loop,
and for each parameter, it creates a pivot table on a separate tab.

I was previously connecting to an MS Access database, but I converted the
Pivot Table's VBA so that it could read from SQL Server...

With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
.Connection = _
"ODBC;DRIVER=SQL Server;SERVER=" & strServerName & ";UID=" & strUID
& ";PWD=" & strPWD & ";MaxBufferSize=2048;PageTimeout=10;"
.CommandType = xlCmdSql
.CommandText = Array(strSQL)
.CreatePivotTable TableDestination:= _
"'[" & ThisWorkbook.Name & "]" & PivotLocation,
TableName:=strPivotName, _
DefaultVersion:=xlPivotTableVersion10
End With

But now, it only succeeds in the first passed parameter of the loop. i.e.
the next parameter returns an empty pivot table.

The reason I haven't provided the code for the loop, is because I only
changed the above code.

What is it about SQL Server that would change being able to loop this vs
being able to loop this in MS Access?
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
Excel Pivot Table connected to an Access Database Data Source Alex Zimmerhaven Excel Discussion (Misc queries) 2 June 10th 08 03:04 AM
How do I refresh Pivot Table from an external source ? fbagirov Excel Worksheet Functions 3 November 13th 07 08:58 PM
excel is connected to sharepoint server and says too many members puneet kinger Excel Discussion (Misc queries) 0 May 11th 07 12:49 PM
Pivot and changing External data source Peter Excel Discussion (Misc queries) 3 January 13th 05 04:59 PM
group pivot table from external source scottwilsonx[_60_] Excel Programming 1 October 25th 04 10:43 AM


All times are GMT +1. The time now is 08:10 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"