Solved

Access to SQL Database from Excel

Posted on 2013-01-22
4
230 Views
Last Modified: 2013-02-20
Hi all

I have a data stored in Microsoft sql 2005 database.. and 2008 version as well
The sql system is in a secured zone.
I have a Microsoft IIS Web server located in the same network as the sql DBs

I have a local computer desktop Windows 7 Enterprise Edition in a diffrent segment/network.
I have an Microsoft Excel version 2010 Application installed in the Desktop

Deskop Windows can access a shared folder in the same network as the DB via a single  shared folder.
Desktop Windows can access the webserver via an open http://web link outside the firewall

What is the best and secured way to access the DB data stored in MSSSQL DB via Excel.. 2010 Application.

Thanks in Advance for your inputs.

Regards
ZH
0
Comment
Question by:ZURINET
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
sognoct earned 251 total points
ID: 38806117
I'm not a excel expert ... but you can use securely vb script

Public aCon As New ADODB.Connection
Public aCmd As New ADODB.Command

Sub Connect()
  Dim sConn As String
  sConn = "Provider=SQLOLEDB;Trusted_Connection=Yes;Server=[SVR];Database=[DB]"
  With aCon
    .ConnectionString = sConn
    .CursorLocation = adUseClient
    .Open
  End With
  BuildProcs
End Sub

Open in new window


then you can populate sheet with data provided by sql server according to your needs

or you can use graphic tools like "external data" read here :
excel get data from a sql database
0
 

Author Comment

by:ZURINET
ID: 38810016
Hi sognoct

Thanks for your reply
But some how you did not understand my question..

I am working on a solution..
Where by I periodically export the needed data as csv. file to the local folder
Then I manually Import the the csv. file into excel
0
 
LVL 3

Assisted Solution

by:JuanchoVzla
JuanchoVzla earned 249 total points
ID: 38810248
Hi Zurinet,

I know it might be too obviuos, but have you tried a data connection?
Excel Data Connection
Hope it helps,

JC
0
 

Author Closing Comment

by:ZURINET
ID: 38909110
Had a work around
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sort GridView by ID Descending 1 13
SQL Query Help Top 1 and Distinct? 6 26
Formula Help 3 23
MailAddress in vb 4 15
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Know what services you can and cannot, should and should not combine on your server.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question