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?
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: