Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Table Error Message - "Command Text not set for command obje | Excel Discussion (Misc queries) | |||
How do I pass a value in a range command | Excel Programming | |||
Control Pivot Table By Command Buttons | Excel Discussion (Misc queries) | |||
select range for pivot table command | Excel Programming | |||
command button in pivot table | Excel Programming |