Upgrade record

How can i upgrade record from excel to db table (msaccess), when i use vsto dataset merged into excel spreadsheet ?

Have you a sample please ?

Thank you
Carlo Cantoni

[174 byte] By [CarloCantoni] at [2008-2-10]
# 1

Hi Carlo,

Assuming that you are referring to a cached dataset within the Excel workbook, one way that you could update the data in the Access database is to call the Update method of the TableAdapter.

The code below was created by using the Northwind database's Customers table which I used to create a cached dataset in the Excel workbook. I modified a record within the cached dataset and then called the following code to update the Customer's table with this change.

Globals.Sheet1.CustomersTableAdapter.Update(Globals.Sheet1.NorthwindDataSet.Customers)

Regards,

Ken Laws
MSFT

This posting is provided "AS IS" with no warranties, and confers no rights.

For more information regarding Visual Studio Tools for Office 2005:

Best of Blogs: Visual Studio 2005 Tools for Office
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_2003_ta/html/odc_landvsto2005_ta.asp

Visual Studio Tools for Office Forum
http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=16

Visual Studio Tools for the Microsoft Office System
http://msdn.microsoft.com/office/understanding/vsto/default.aspx

KenLaws at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 2
Thank you for your suggestion, this code function perfectly.
Is the same instruction for a dataset into word ?

Thank you
Carlo Cantoni

CarloCantoni at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 3

Hi Carlo,

Yes, you should be able to use the same code within a Microsoft Word VSTO project to update the underlying data source.

You would obviously need to change the code slightly such as:

Globals.ThisDocument.CustomersTableAdapter.Update(Globals.ThisDocument.NorthwindDataSet.Customers)
Regards,

Ken Laws
MSFT

This posting is provided "AS IS" with no warranties, and confers no rights.

For more information regarding Visual Studio Tools for Office 2005:

Best of Blogs: Visual Studio 2005 Tools for Office
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_2003_ta/html/odc_landvsto2005_ta.asp

Visual Studio Tools for Office Forum
http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=16

Visual Studio Tools for the Microsoft Office System
http://msdn.microsoft.com/office/understanding/vsto/default.aspx

KenLaws at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...