
Copy a Table to another Table
Question, (VB6 +Acces97)
Is it possible to copy an acces table (e.g. TABLE1) with about 5000 records
to a new table (e.g. TABLE2 which is empty).
The way I do it now is:
I open TABLE1 and select all records.=>
Data1.databasename="Database.mdb"
Data1.recorssettype=0
Data1.recordsource="TABLE1"
Data1.refresh
Data2.databasename="Database.mdb" 'Same database as Data1
Data2.recordsettype= 0
Data2.recordsource="NEW" ' This is an empty table with the
same structure as TABLE1
with Data1.recordset
.movelast
.movefirst
Do while not .EOF
Data2.recordset.addnew
Data2.recordset.fields(0)= .Fields(0)
Data2.recordset.fields(1)= .Fields(1)
Data2.recordset.fields(2)= .Fields(2)
Data2.recordset.fields(3)= .Fields(3)
Data2.recordset.fields(4)= .Fields(4)
Data2.recordset.fields(5)= .Fields(5)
Data2.recordset.fields(6)= .Fields(6)
Data2.recordset.Update
.Movenext
Loop
End With
This way is working, only the speed is to slow for me.
Is it possible to copy table Table1 direct to table NEW without opening
Tabl1 and do it record by record.
I hope someone can give me an answer
Thanks
Gerwin Spijkerboer