Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Pass a command text in pivot table

I've got a pivot table with data give back by odbc (in excel 2003).
When i pass a new sql command, it answer me the database, also if i pass the
connection string. My code is this:

With ActiveSheet.PivotTables(sNamePivot).PivotCache
.CommandText = sSelect
.Connection = "ODBC;DSN=DS;DB=" & NomeDB & ";SRVR=;UID=SYSADM;PWD="
.Refresh
End With

sNamePivot -- string variable contain the correct name of the pivot table.
NomeDB -- string variable contain the database.
sSelect -- variable contain the sql command.

Why does it called me the database, if i pass also the connection???
Thanks for every help.

Ps. if i don't pass the commandtext, macro updating the pivot without call
me the database.
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
Pivot Table Error Message - "Command Text not set for command obje Jeff Divian Excel Discussion (Misc queries) 0 November 7th 07 10:26 PM
How do I pass a value in a range command mopgcw Excel Programming 5 September 13th 07 04:14 PM
Control Pivot Table By Command Buttons [email protected] Excel Discussion (Misc queries) 0 March 21st 07 04:18 PM
select range for pivot table command Richard Excel Programming 3 October 23rd 06 06:14 PM
command button in pivot table kanan Excel Programming 0 April 9th 04 12:46 AM


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