Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling a Dataset from Excel and then inserting the data into Access

Status
Not open for further replies.

redav

Programmer
Mar 20, 2001
55
GB
Hi

I want to use code to import an Excel worksheet into an Access table.

I can easily fill a dataset from the Excel worksheet but I am having problem getting the data into Access.

I am using a DataAdapter update command (which I have used in other apps) but obviously the DataRowState for each row in the dataTable is Unchanged so no records are inserted.

I tried setting the DataRowState to Added but as I'm sure you know this is read only.

Next I tried looping through the rows in my original DataTable and adding them into a second DataSet and DataTable which I was going to use for my update but the error is 'This row already belongs to another table'.

Is there an easy way to do this or must I loop though each row putting each item seperately into a second datatable?

Thanks

redav
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top