|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, July 08, 2010 9:43 AM
Points: 2,
Visits: 8
|
|
This type of a solution is extraordinarily powerful. Being able to retrieve data directly from the database for use in Excel has been a huge help in trying to get information out to the users. Once the data is in VBA, there are lots of other nice things that can be done with the data via VBA that doesn't work quite as well with SQL (my opinion). In addition, formatting of the spreadsheet is endless with VBA. With that said, i would like to add some caveats...
PROTECT YOUR CODE. In your example, the connection string had the userid and password in the clear. One person already mentioned this. This is really, really bad. If you don't have very tight controls over who can access data in your database, you have opened yourself up to data corruption from nefarious users that have free reign in your SQL Server once they find the userid and password. Several ways to work with this - PASSWORD PROTECT your VBA code - don't let your users see this. It is more work for the developer - you need to write the code to retrieve information, but it keeps people from doing bad things. Your reports become in effect, read only. Use an ODBC connection. It would need to be set up on the users machine, and depending on how many you have, this could be problematic (or not). Create a generic userid / password that gives access to selected files as READ ONLY. You do not have to put userid / password into the connection string.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, November 14, 2008 6:46 AM
Points: 1,
Visits: 6
|
|
| I use ExcelWriter and combine with VBA through application to display SQL data to the Excel. This is more secure to data server I think.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, August 10, 2012 6:08 PM
Points: 1,156,
Visits: 801
|
|
hug.newsletter (10/3/2008) This is exactly the type of solution I come across every day in our organization and I absolutely hate it!
Oiye...
Wow. I whole-heartedly agree! I am sitting here reading this post with some small amount of terror... of the pain of experience in dealing with such issues. It seems that every organization has some self appointed Excel evangelist that I spend half my time having to DEBUNK the values s/he contorted into their PIVOT and postulated to management as a whole. I despise having to go and fix their range calls, rounding errors, truncated zeros, and etcetera, merely because "our numbers do not match".
As a standard of practice, anytime someone comes to me with an Excel reporting issue, I lay it aside and go DIRECTLY to the source of the data. They are usually saying, "But that is not what my Excel sheet says...". It takes far less time to get the facts straight than trying to absorb their particular self-inflicted Excel predicament.
And the awful plentitude of those that think Excel is a good format to ship data in... Lesson #1: Zip Codes do NOT play well in Excel without some careful hand-holding, which never seems to happen at the sender end.
--- soap box mode = off ---
Please pardon my rant...
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Monday, July 30, 2012 10:42 AM
Points: 3,434,
Visits: 519
|
|
I prefer SSRS (Reporting Services) with its Export button where you can export to Excel, PDF and other formats.
Regards, Yelena Varshal
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, August 10, 2012 6:08 PM
Points: 1,156,
Visits: 801
|
|
Yelena Varshal (10/3/2008) I prefer SSRS (Reporting Services) with its Export button where you can export to Excel, PDF and other formats.
Agreed. As long as the end user sticks to the source, the export for walking is fine in Excel (with minimal caveats).
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Yesterday @ 8:21 PM
Points: 32,893,
Visits: 26,765
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, April 26, 2013 4:05 AM
Points: 193,
Visits: 1,248
|
|
"Jeez... doesn't anyone know how to use "Get External Data" on a simple view anymore? " I like that.
The problem is however bigger. In my part of the world (Sweden) I know many people using Excel but very few (not IT-professional) how can get data from anywhere. Even if it is simple for use "Get External data etc" it is not for a person like a controller and this method may also not be promoted by the IT-department. The worst that can happen is if the "controller" starts to develope an "application" in VBA with macros etc. He she is desparately in need for something which more then one question using something like "Get extenal data etc" There are a bunch of reporting/analysing tool on the market so the question why use Excel? Excel is an excellent reporting tool. But may be Excel is considered as a toy tool and nobody in the IT-department will promote professional use of it. Microsoft is also unclear about VBA in future releasis of Excel. I also use Excel and VB.net but that makes it more difficult !?
//Gosta
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, April 17, 2012 5:38 AM
Points: 16,
Visits: 93
|
|
Jeez... doesn't anyone know how to use "Get External Data" on a simple view anymore
IN MSOFFICE-2000 BELOW???
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, April 17, 2012 5:38 AM
Points: 16,
Visits: 93
|
|
FOR ALL THOSE WHO GREAT FANS OF "Get External Data" my suggestion is to read the article again as the installation dependency of "microsoft query" made me write this article as an alternativ..
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Yesterday @ 8:21 PM
Points: 32,893,
Visits: 26,765
|
|
So? It's a great tool and it's a hell of a lot better than redistributing code everytime you need to make a change. Teach the users how to support themselves using "Get External Data". It saves a huge amount of time in the long run.
--Jeff Moden "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
|
|
|
|