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

Copying information from one table to another

Status
Not open for further replies.

woodyinoz

IS-IT--Management
Jan 8, 2002
215
GB
Hi all,

Just a quick simple question.

What code would I use to copy all of the information from table1 into table2 (apphending the data to table2) and then empty table1?

Thanks,

Woody.
 
var
tbl table
endvar

tbl.attach("tablr1.db")
tbl.add("table2.db", true, true)
tbl.unattach()

-> In order to work properly, your tables must be indexed.
 
Incase anyone needed to do this in the future I thought I'd post the solution I found to my problem.

Transfer:

method pushButton(var eventInfo Event)

var
dt DataTransfer
endVar

dt.SetSource ( "Temp Import.db" )
if dt.getSourceType ( ) = DTASCIIFixed Then
dt.loadDestSpec ( "SpecTable" )
EndIf
dt.setDest ( "PartReport.db" )
if not dt.getAppend () then
dt.setAppend ( True )
endif
dt.transferData ( )

endMethod


Empty:

method pushButton(var eventInfo Event)

Empty("PartReport.db")

endMethod


I hope this might help people in the future.

Woody.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top