Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7726077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:07:20+00:00 2026-06-01T05:07:20+00:00

We have a SQL Server 2008 database that has stored procedures to handle reads/writes/etc.

  • 0

We have a SQL Server 2008 database that has stored procedures to handle reads/writes/etc. These procedures are used by a variety of applications internally.

The need has come up for a single person to make updates directly to a one of the tables in the database called Employee. The update is dirt simple; update VARCHAR and INT (foreign key) fields. The problem is that SharePoint 2010 doesn’t easily support this kind of update through BCS; browsing and updating isn’t the best user experience.

It’s been suggested that this is easily solved with Excel and VBA. On open, Excel connects to the SQL Server database and reads from the Employee read stored procedure. It also executes the read sprocs for the tables the foreign keys reference. The user makes an update to a field, which in turn calls the Employee update sproc.

The advantages to this are that there is no website interface that needs to be built/hosted/etc; the DBA is fine with this approach if Active Directory is used to authenticate.

The problem is that I can’t find a VBA programmer or any helpful resources or step-by-step walk throughs to write the VBA.

Does anyone know of such an online resource and/or have an alternate suggestion on how to quickly get an admin interface up and running for the single user?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:07:22+00:00Added an answer on June 1, 2026 at 5:07 am

    I ended up going with this approach using AD authentication. I used the example in this post for inspiration:
    http://www.eggheadcafe.com/community/sql-server/13/10141669/using-excel-to-update-data-on-ms-sql-tables.aspx

    Note that these functions live in different areas of the Excel Workbook (Objects, Modules, This Workbook), but here’s a quick reference.

    I also have each of the columns that are FK validating against the tables they reference.

    Here are some code samples:

    Public aCon As New ADODB.Connection
    Public aCmd As New ADODB.Command
    
    Private Sub Workbook_Open()
      Application.EnableEvents = False
      PopulateSheet
      Application.EnableEvents = True
    End Sub
    
    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
    
    Sub BuildProcs()
      With aCmd
        .ActiveConnection = aCon
        .CommandType = adCmdStoredProc
        .CommandText = "[SPROC]"
        .Parameters.Append .CreateParameter("@in_EmployeeID", adInteger, adParamInput)
      End With
    
    End Sub
    
    Sub PopulateSheet()
      Dim n As Integer, r As Long
    
      Dim aCmdFetchEmployees As New ADODB.Command
      Dim aRstEmployees As New ADODB.Recordset
    
      If aCon.State = adStateClosed Then Connect
    
      With aCmdFetchEmployees
        .ActiveConnection = aCon
        .CommandType = adCmdStoredProc
        .CommandText = "[SPROC]"
        Set aRstEmployees = .Execute
      End With
      r = aRstEmployees.RecordCount
    
      Worksheets(1).Activate
      Application.ScreenUpdating = False
      Cells(2, 1).CopyFromRecordset aRstEmployees
    
      For n = 1 To aRstEmployees.Fields.Count
        Cells(1, n) = aRstEmployees(n - 1).Name
        Cells(1, n).EntireColumn.AutoFit
      Next
      Cells(1).EntireColumn.Hidden = True
    End Sub
    
    Private Sub Worksheet_Change(ByVal Target As Range)
      Dim cell As Range
      If aCon.State = adStateClosed Then Connect
        With aCmd
          .Parameters(0) = Cells(Target.Row, 1)
          .Parameters(1) = Cells(Target.Row, 4)
          .Parameters(2) = Cells(Target.Row, 5)
          .Parameters(3) = Cells(Target.Row, 6)
          .Parameters(4) = Cells(Target.Row, 7)
          .Parameters(5) = Cells(Target.Row, 8)
          .Parameters(6) = Cells(Target.Row, 10)
          .Parameters(7) = Cells(Target.Row, 11)
          .Parameters(8) = Cells(Target.Row, 12)
          .Parameters(9) = Cells(Target.Row, 13)
          .Parameters(10) = Cells(Target.Row, 14)
          .Parameters(11) = Cells(Target.Row, 15)
          .Parameters(12) = Cells(Target.Row, 16)
          .Execute , , adExecuteNoRecords
        End With
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL Server 2008 database. This database has a stored procedure that
I have a table in a sql server 2008 database that contains bunch of
I have an application that accesses a sql server 2008 database. The server and
I have a database that I have created using SQL Server Developer 2008. I
A have a database on MS-SQL Server 2008 that is growing a lot, year
We use SQL server 2008 as our RDBMS and we have a database that
I am using playframework with a legacy SQL Server 2008 database that has data
I have SQL Server 2008 database with 2 tables: Table A has columns ID
I have a SQL Server 2008 database. This database has two related tables: Customer
Okay. I have a database that has bunch of stored procedures and references another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.