1

I need help, I'm trying to give one of our employees an Excel sheet that pulls data from a SQL table, and then allows her to update some fields using Excel back to the SQL Table. I have the Data connection setup so Excel can pull data from SQL correctly, but I'm having no luck getting Excel to send the data back to the SQL table and update the fields. I've seen multiple code examples that seem to do something similar to what I'm looking for but I can't get any traction on it.

Can anyone help me out here?

Mahmoud Gamal
  • 78,257
  • 17
  • 139
  • 164
Derek Lester
  • 11
  • 2
  • 4
  • Have you had a chance to look at this post? http://stackoverflow.com/questions/3767879/insert-data-from-excel-into-sql-db – Vinnie Sep 06 '12 at 15:12
  • check this: http://stackoverflow.com/questions/750565/writing-data-back-to-sql-from-excel-sheet?rq=1 and this: http://msdn.microsoft.com/en-us/library/ms680928%28VS.85%29.aspx – Nathan Sep 06 '12 at 15:13
  • I did look at the first link, and I'm not sure how to apply this to our need. I want to try and have this done in one of two ways: 1) Once data is entered into the cell, the user clicks a button that runs the update procedure to the SQL table, or 2) when data is refreshed from the SQL table to Excel, the updated fields are sent to SQL. – Derek Lester Sep 06 '12 at 15:22
  • I also just tried Nathan's suggestions, and it kinda worked except it just appended already existing rows back to the table, duplicating all the data. – Derek Lester Sep 06 '12 at 16:45

1 Answers1

1

I've tried this a few times and it's never worked out very well, far easier for me and our employees has been to use Access with a linked table that allows data to be written directly back to the server. If possible it might be worth exploring this as it's a completely 'out of the box' solution.

bendataclear
  • 3,802
  • 3
  • 32
  • 51