SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Let the Excel Play


Let the Excel Play

Author
Message
ppeterson
ppeterson
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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.
jin lin
jin lin
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 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.
DPhillips-731960
DPhillips-731960
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1368 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...
Yelena Varshal
Yelena Varshal
SSCertifiable
SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)

Group: General Forum Members
Points: 5702 Visits: 597
I prefer SSRS (Reporting Services) with its Export button where you can export to Excel, PDF and other formats.


Regards,
Yelena Varshal

DPhillips-731960
DPhillips-731960
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1368 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).
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)

Group: General Forum Members
Points: 119180 Visits: 41482
Jeez... doesn't anyone know how to use "Get External Data" on a simple view anymore? Wink

--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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Gosta Munktell
Gosta Munktell
Right there with Babe
Right there with Babe (767 reputation)Right there with Babe (767 reputation)Right there with Babe (767 reputation)Right there with Babe (767 reputation)Right there with Babe (767 reputation)Right there with Babe (767 reputation)Right there with Babe (767 reputation)Right there with Babe (767 reputation)

Group: General Forum Members
Points: 767 Visits: 2161
"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
shashank-666535
shashank-666535
SSC Rookie
SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)

Group: General Forum Members
Points: 44 Visits: 93
Jeez... doesn't anyone know how to use "Get External Data" on a simple view anymore

IN MSOFFICE-2000 BELOW???
shashank-666535
shashank-666535
SSC Rookie
SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)

Group: General Forum Members
Points: 44 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..
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)SSC Guru (119K reputation)

Group: General Forum Members
Points: 119180 Visits: 41482
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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search