View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.sqlserver.programming
onedaywhen onedaywhen is offline
external usenet poster
 
Posts: 459
Default How to write back a SQL Server table from Excel

I've often seen this question posed here and I've yet to see a good
generalized answer. After a quick glance at your post, my opinion
hasn't changed.

Can you explain how you have anticipated the OP using your code? There
seems to be so many premises (the variable iPK, only one column may
comprise the primary key, datatypes, etc) I don't think it can be
generalized for the OP's needs. Please, please, prove me wrong.

--

"Roger Whitehead" wrote in message ...

Belinda, This little lot updates from Excel to the Source
RST1_ADO is an ADO.Recordset
It uses the same SQL string to UPDATE, as the Query that SELECTED the data
into Excel. I colour-fill cells that require update, in a vain attempt to
save time.

<snip


"Belinda" wrote in message
om...
I want to read a SQL Server table into Excel and then make changes to
it and then update the Excel range back to SQL Server. Also, I want to
be able to add new rows or delete rows in a range and reflect back the
same into SQL Server. In simple words I want to do the same thing what
Access Link table does from SQL Server. One of the main problems I
face is how to identify the range the query populated in Excel ?

Then how to track what rows were deleted and what were inserted newly
and what was updated.

If any of you have a VBA / t-SQL code for this it is highly
appreciated.

Thanks
Belinda