Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««1234»»»

Let the Excel Play Expand / Collapse
Author
Message
Posted Friday, October 3, 2008 8:47 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 8, 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.
Post #580332
Posted Friday, October 3, 2008 9:02 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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.
Post #580346
Posted Friday, October 3, 2008 10:04 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen 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...
Post #580412
Posted Friday, October 3, 2008 11:50 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Monday, September 15, 2014 4:12 PM
Points: 3,475, Visits: 582
I prefer SSRS (Reporting Services) with its Export button where you can export to Excel, PDF and other formats.


Regards,
Yelena Varshal

Post #580489
Posted Friday, October 3, 2008 12:15 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen 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).
Post #580509
Posted Saturday, October 4, 2008 1:12 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 10:28 PM
Points: 35,215, Visits: 31,666
Jeez... doesn't anyone know how to use "Get External Data" on a simple view anymore? ;)

--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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #580743
Posted Sunday, October 5, 2008 3:07 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, September 18, 2014 2:26 AM
Points: 204, Visits: 1,336
"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

Post #580819
Posted Sunday, October 5, 2008 4:33 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

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???
Post #580828
Posted Sunday, October 5, 2008 4:37 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

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..

Post #580829
Posted Sunday, October 5, 2008 6:39 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 10:28 PM
Points: 35,215, Visits: 31,666
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #580841
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse