Hil all,
I'm going to select and insert table data from another database to current database, I can do this easily with select and insert all fields (*), but it's difficult to type each field if I don't want to insert except ID field. because there are many fields in the table.
And I want to write the code in this form :
Is it possible?
I'm going to select and insert table data from another database to current database, I can do this easily with select and insert all fields (*), but it's difficult to type each field if I don't want to insert except ID field. because there are many fields in the table.
Code:
pth = "I:\Test37.accdb"
pSQL = "INSERT INTO tbl_Data(D_Name,D_Family,D_Father,D_Date,D_Mariddle,D_Edu,........) SELECT D_Name,D_Family,D_Father,D_Date,D_Mariddle,D_Edu,..... FROM [MS Access;DATABASE=" & pth & "].tbl_Data"
And I want to write the code in this form :
Code:
pth = "I:\Test37.accdb"
pSQL = "INSERT INTO tbl_Data("Select all fields except ID") SELECT "Select all fields except ID" FROM [MS Access;DATABASE=" & pth & "].tbl_Data"
Is it possible?
Last edited: