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.
0
Utf
12/15/2009 2:04:01 PM
excel.programming 6508 articles. 2 followers. Follow

0 Replies
1758 Views

Similar Articles

[PageSpeed] 18

Reply:

Similar Artilces:

Exchange rich-text format
What are the results from the client side if I change my Exchange 2003 server to "Alwayes Use" Exchange Rich-Text format from "Determined by individual user settings"? On Thu, 22 Jun 2006 08:31:01 -0700, CK <CK@discussions.microsoft.com> wrote: >What are the results from the client side if I change my Exchange 2003 server >to "Alwayes Use" Exchange Rich-Text format from "Determined by individual >user settings"? Depends on what your users are sending messages as. Most will be using HTML or RTF anyway unless you have some policy in p...

Passing Outlook objects between threads C++
Im using C++ VS2005 and in the main thread I establish a reference to an Outlook Contact Item. I call the Display method and it correctly creates an inspector and displays the Contact. While the Contact is open I pass a IDISPATCH pointer to the Contact to another thread. In the new thread I AddRef the Contact, the pointer seems good because I can get various properties, FileAs etc. However when I try to call the Close method I get an invalid access exception (the method does not return with an hr result). Watching the Inspector events, OnClose and OnCloseComplete do get called before ...

Importing Text File #3
Did ya ever have one of those lucky accidents that you like and would like to replicate? I created a simple excel workbook based on imported text data. Later, when I reopended the file, I noticed that the "refresh" button was activated and would auto import when I clicked. The best part is that the import specs were retained. I have no idea how I did this and have not been able to replicate the functionality. Can someone help? Thanks Bean, It sounds as if you used Data - Get external data. It remembers all the paramaters you specify, and you have only to do a refresh, ...

Display Part Text In Report
I hv this sample report in my field 01-01-08ABCDE.................... I want to display ABCDE........and so on...and not the 01-01-08 What should i do... Thanks zyus, Try this in the Control Source of a text box on your report: =Mid([YourFieldName],9) Caution: The text box name must be different than the field name. If they are the same, change the text box name to txtYourFieldName. Good luck. -- Sco M.L. "Sco" Scofield, MCSD, MCP, MSS, A+, Access MVP 2001 - 2005 Denver Area Access Users Group Past President 2006/2007 www.DAAUG.org MS Colorado Events Administrator www....

How to remove the alternative text box from the publisher email?
Hi, I have created a publisher email and have email it to myself for testing view. I find there is a small alternative text box appearing whenever my mouse cursor station at any point of the email. How to remove this alternative text box from the publisher email? Help... -- Thank you, Cpviv Sounds like all the text has was converted to an image. Try to select the text and you will see it is an image. Go to tools > Options > Web tab and under Email options uncheck the option to send as an image. If that doesn't fix the problem, reference: Tips and troubleshooting for ...

Change from MS Outlook Rich Text to HTML
I use Outlook 98 and I want to change my message format to HTML so that I can have nice backgrounds etc on my mail. For some reason this facility doesn't seem to be available to me on the 'Mail Format' Tab. It is blacked out and I cannot change it from Rich Text to HTML. Is there anything I can do to sort this out? Could it be because I am on a network at work and they have disabled it? If so, how can I enable it? Cheers! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www...

If statement with formatted text
Hi, Is there any way to have an if formula such as: If (A1="Active", "KAE",KPE") where the two letters after the K are formatted as subscript? The best I've done is to paste a picture over the cell. The picture's formula refers to named formula that selects one of two cells, the one with correct string. One cell contains KAE and the other KPE with the subscript. However, it means that I'm using a picture and it would be much nicer if I could just do it in an If formula. I hope that makes some kind of sense, and thanks in advance for your help. D...

Trouble with hyhens within text when using LOOKUP
I have two columns, each containing a list of part numbers. Some of the part numbers contain hyphens. I am using LOOKUP and/or VLOOKUP to determine if the value in one column exists in the other. This works great on non-hyphenated part numbers. However, it will not find or return the hyphenated part numbers from the specified arrays. As a test, I did a quick if statement to compare the instances of identical hyphenated values that exist in both columns. Those statements did not have a problem with the hyphens. Can anyone offer any help? If hyphens cannot be used in conjunction with the ...

instructions disppear when users begin type (text field)
Hi all, I need to customize the outlook contact form and I want to add one text field to allow users to add details info and instruct users how to add. Instructions shows in the field and the instructions disappear when users click and begin to type. How should I do this? exchange 2003/outlook2003 Thank you. It's hard for me to visualize exactly what you're expecting to happen. If you want the instructions to stay on the screen, you could display them in a label control. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumps...

Saving html message as Draft changes text formatting...
WIN XP HE, OL 2002 Hi, I have recently noticed that whenever I write an email (using Word as editor) in html format, and instead of sending it, save it (to the drafts folder), the text itself changes format from my default to another one. It seems to change in the paragraph style which then changes the text format. The only change I recently made was to edit my signatures in html, rtf and plain text format. When I write a new email, it opens up with the signature already in it and perhaps there are format/style conflicts..? Tx for shedding some light into this. S As an added information, t...

Pivot Table with Quarter Subtotals across the top
Hello, I'm constantly creating pivot tables that show sales information by date across the top from left to right. I would love to insert a subtotal at the end of each calender quarter to subtotal the last three months. As it stands right now I just drop in the "Month" field from the data into the pivot table and the months flow through the pivot table. Is it possible to insert a quarter subtotal, say "1Q07" that will sum Jan-07, Feb-07 & Mar-07? Thanks in advance, Dza In 2007- Select any date heading, on the options ribbon click Group Field in the Group g...

Using cell text in a formula
I am trying to use derived cell references in a VLOOKUP formula to matc data in several tables. For example, A1 contains the cell reference fo the top left of my array (A3) whilst cell A2 contains the cel reference for the bottom right of my array (D14). The array I' checking against starts in column E3. However, when I use the formula =VLOOKUP(E3,A1:A2,4,FALSE) I get a #N/ error. I need to use the cell references in each VLOOKUP as the arra sizes may vary in each case. (PS, I've used =INDIRECT(ADDRESS(A1,A2) to derive the cell references. Ji -- Message posted from http://www.Excel...

cannot view all of text in large cell, even though I have it to w.
I have cell format to wrap text and it works fine to a p[oint then no more text is displayed....casn increase the size of the cell, but still only so much will display....rest of the cell show blank. Hi +the limit is 1024 characters. You can extend this with manually inserting linebrekas using aLT+ENTER -- Regards Frank Kabel Frankfurt, Germany sydme wrote: > I have cell format to wrap text and it works fine to a p[oint then no > more text is displayed....casn increase the size of the cell, but > still only so much will display....rest of the cell show blank. ...

Suggest a solution
Hi all. I have a table named Articles that has the fields: ArticleID, ArticleName, Price and so on.... What I want to do is to make a new table that would hold some related Property records for each article. For example... Color, Weight, Length,.. This is not a problem, but what I want is to be able to change fields names for the second table (like PropertyID, PropertyName) and be able to search among those values from query. This is the most important part: ---------------------------------------------------------------- I would like to have them as a field in query from ...

can lookup return cell reference istead of "text" for sumif?
I am trying to use a lookup-function to determine a different sum range for several criteria. Like so: =Sumif($A$7:$A$1447;"<"&X3;vlookup(e3;AT3:AU11;2;false)-Sumif($A$7:$A $1447;"<"&y3;vlookup(e3;AT3:AU11;2;false) The problem is that the vlookup returns text and not the cell reference. Is there a way to get the answer from the lookup expressed as cell reference instead of text, since sumif can't use text, just the cell reference? I use it to calculate the number of hours the staff should be paid, so it's different from weekdays to saturdays, holidays...

auto filter data within pivot table
Hello, Does anyone know how can we filter data within a pivot table? or sort the data from ascending to decending order withing a pivot table??? Can we do that? It doesnt seems to work?! Thanks. Elaine. You can add fields to the page area, and use them to filter the pivot table's data. To sort a field, select a cell in a column, and click the A-Z button on the Excel toolbar. elaine wrote: > Does anyone know how can we filter data within a pivot table? or sort > the data from ascending to decending order withing a pivot table??? > Can we do that? > > It doesnt se...

Text box jumps to left of page
Word 2004 (I am relatively new to Word and am delighted to find a forum specifically for the Mac version. There are a number of unresolved, niggling issues I can live however they slow the workflow. I am eager to learn.) In the recent past, I manually converted 12,000+ recipes from WordPerfect 7 to Word. Since Word 2004 does not have a filter for the old files, the conversion was done on the Windows side of my Mac in Word2003. Those files _usually_ open without protest also in 2004. One annoyance regards text boxes. When text was highlighted and a text box was requested for it in...

How did you add text into publisher, without using boxes?
how do you add text to publisher without using text boxes I suppose you could create your text as an image and insert the image into your publisher file. -- Don Vancouver, USA "Calvin Scott" <Calvin Scott@discussions.microsoft.com> wrote in message news:64D23D52-138D-47B4-B265-4A41BF14BF55@microsoft.com... > how do you add text to publisher without using text boxes Calvin Scott <Calvin Scott@discussions.microsoft.com> was very recently heard to utter: > how do you add text to publisher without using text boxes You don't. Text in Publisher has to e...

look way to map form at CRM frontend to tables at CRM database
How can I find out what tables which new record has been added on when I enter data through a form in CRM front end? I try to find way to map form in the CRM frontend to the tables at the CRM database at backend? It is CRM 3.0 Thank in advances for help! ...

Create your personal SMS homepage, let friends send FREE text message to your mobile phone by web
Create your personal SMS homepage, let friends send FREE text message to your mobile phone by web Support over 147 countries and ALL languages (unicode encoding) MSG.to provides a unique personal SMS URL for you. It is easy for friends sending text message to you by web. For example, if your name is Lisa, you can register: http://MSG.to/Lisa (you can use this link to see demo) You can also register your mobile phone number as SMS URL like: http://MSG.to/+886913123456 (you can use this link to see demo) Please visit http://msg.to/ for more information. Related keywords: Short Message Serv...

Editing more than 1 table at a time with SQL.
Say I have two tables in a DB called TABLE1, and TABLE2. TABLE1 [IDNUMBER] [FIRSTNAME] 1 Ryan 2 Jennifer 3 Monica TABLE2 [IDNUMBER] [LASTNAME] 1 Johnson 2 Snipes 3 Smith My question is would I be able to use SQL in code to Edit, Delete or Insert data to both tables in one string rather than one table at a time? For instance what if I want to change both tables with a [IDNUMBER] = 2 to a [IDNUMBER] = 4, OR change the ...

Pass IT Certification exam in 1st attempt.
Pass IT Certification exam in 1st attempt. Hello friends, i have just visited http://www.FreeExamKing.com and found its great regarding all certification latest dumps material like mcse, mcse 2003, mcts, ccna, ccie, ccnp, oracle 9i, oracle 10g, oracle 11i, filemaker, A+, server+, project+, PMI, Vmware and many more. so visit http://www.FreeExamKing.com hope you will find it too good for passing your IT certification exam in 1st attempt. ...

I am having trouble keeping numbers formatted in a Pivot Table
I have a pivot table that won't stay formatted. The data is formatted as currency in the worksheet that the Pivot Table is drawing off of. It shows up as a general number in the Pivot. I've tried formatting it in the Pivot but it doesn't stay when I refresh the data. "Preserve formatting" is checked on the Pivot table, so it SHOULD be preserving any formatting I apply to the pivot table, but that doesn't seem to be happening. I know I could record a macro to format this, but it is happening on multiple Pivot tables in the same workbook and that would be a pain ...

Do you need MS Access to query on an Access table?
I'm asking these questions because I have looked at a lot of stuff in the discussion groups and still confused. I am fairly good at Excel programming but haven't been able to get Excel and Access to talk. First, I have Office 2003 Professional at work and Office 2003 without Access at home. I want to work on developing Excel programming at home which will get data from Access to Excel with either MS Query or with programming. Is it possible to just have the .mdb files on the home computer for Excel to work with, or do I need the Access program too? The info I want ...

Table headers in a list box (Custom Report)
I have a big table with many fields (more than fifty). They are not in one table but related. Now user's come with a requirement of a separate type of report everyday which has different fields. because of which i have to design a report for them with the required query. I was therefore wondering can i make a form which has two list boxes the one on left side will have all the fields of the table (only headers needed, not data). Users can select multiple no. of fields from that list box which will appear in another list box. Users should be able to then select the order of fi...