+ Reply to Thread
Results 1 to 7 of 7

Dangers of connecting to SQL Server

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Dangers of connecting to SQL Server

    Hi,

    I've been using Excel VBA for a while to connect to MS SQL Servers at my company, but now my company's DBA has decided to start denying access to these SQL Servers if I'm choosing to connect via Excel. His knowledge in SQL is obviously above my own, so I'm looking for some understanding from others on whether his claims are well-founded.

    For example, he appears fine with me using a local vbscript to connect to a SQL Server, read data, and store the data in Excel. But when I question on using Excel VBA, he states:
    "MS Office VBA in general causes issues within SQL regardless of whether the connection strings and queries are the same. Office is not a front-end tool."

    Is there truth in this? If so, please let me know what type of issues it can cause.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Dangers of connecting to SQL Server

    Your DBA should only be concerned about applications that store the database username/password locally, which of course is a huge security concern. Since Excel does not create secure compiled applications, I can understand the objection. A possible workaround would be for the DBA to assign VBA developers to a specific role with restricted access (perhaps to certain views or stored procedures) and use Active Directory validation. My choice is to use VBA to run SQL Server Reporting Services (SSRS) reports (that are structured like data dumps) into CSV files and load those files to Excel. SSRS security prevents unauthorized users from accessing the reports.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Re: Dangers of connecting to SQL Server

    The SQL users I've requested are read-only and do not have have access to databases with sensitive information. The VBA Projects are locked as well, but I understand it's not the most secure scenario.

    Do you know of any non-security related issues? His concerns seem to be founded in that the method in which Office products connect to SQL Servers will cause performance issues with the primary application that would be using the same database.

  4. #4
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: Dangers of connecting to SQL Server

    The only real danger is as Ron said, your excel workbook holding the username and password is not safe. Everything else is server side and what tool you use to get the data is moot. You screwing up a database has nothing to do with vba, it has to do with your account being allowed do that. If your DBA doesn't want you to screw up something, your login should not let you do anything that inserts/updates/deletes.

  5. #5
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Re: Dangers of connecting to SQL Server

    So to better frame-up my question, "Are there any known risks associated with using a read-only SQL user login to run select queries on a database with Excel that wouldn't exist with supported reporting tools like Crystal Reports?"

  6. #6
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Re: Dangers of connecting to SQL Server

    Quote Originally Posted by Ron Coderre View Post
    Your DBA should only be concerned about applications that store the database username/password locally, which of course is a huge security concern. Since Excel does not create secure compiled applications, I can understand the objection. A possible workaround would be for the DBA to assign VBA developers to a specific role with restricted access (perhaps to certain views or stored procedures) and use Active Directory validation. My choice is to use VBA to run SQL Server Reporting Services (SSRS) reports (that are structured like data dumps) into CSV files and load those files to Excel. SSRS security prevents unauthorized users from accessing the reports.
    If I put all functions related to the database in a COM Add-in, would that be viewed as secure? Anyone know of any other alternatives to store that information more securely?

  7. #7
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Dangers of connecting to SQL Server

    If you are connecting to the server using VBA and ADO in excel then I do not think there can be a difference to connecting using VBScript. If you are connecting using Excel's external data functions (even using Querytables in VBA) then there can be a difference. The statement "Office is not a front-end tool." is wrong however.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Connecting to a server via http
    By bremen22 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2013, 08:53 PM
  2. Essbase Add-In: Problem connecting to server
    By LRG5151 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-15-2013, 04:32 PM
  3. Excel 2007 : Error connecting to SQL Server 2005
    By louisy in forum Excel General
    Replies: 0
    Last Post: 02-18-2011, 06:42 AM
  4. Connecting to a server
    By cgi_pro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2006, 01:29 AM
  5. [SOLVED] Connecting Excel, Access and SQL Server
    By mp80237 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-01-2006, 12:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1