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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy contents of data table in VB.Net program to empty Access Table 1

Status
Not open for further replies.

CraigBest

Programmer
Aug 1, 2001
545
US
Hi Folks

In a VB.NET 2005 app that I'm building, I've selected records I need to process from an Access DB table into a VB Data Table. Now I want to copy the contents of that data table back into a blank Access table with the same structure. Is there an was to build an Insert query to do this?

CraigHartz
 
Its simply:

INSERT INTO targettable (field1, field2, field3, field4)
SELECT fielda, fieldb, fieldc, fieldd
FROM sourcetable

Assuming that your field types match, referential integrity matches (so you won't get mismatched rows) and that any constraints are identical.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top