Copies a table structure and associated records to a new table.
public void CopyTable( FilterOption filtOpt, String strFile );
The records copied to the new table depend on the FilterOption given.
Index files will not be copied, as they can be created after the copy. The resulting table must be opened by the application after the copy is performed before the application can use the table.
If performing a CopyTable on an ADT table, and that ADT table contains an AutoIncrement field, the AutoIncrement values will be preserved in the destination table. That is, the new records in the destination table will have the same values in the AutoIncrement column as those records in the source table. The next available AutoIncrement value will also be identical in the source and destination tables.
The copy will be done on the server if the following conditions are met:
|•||strFile is on the same server as the file referenced by hObj|
|•||the data reader is not open on a cursor|
|•||the table was not opened exclusively|
If the server cannot perform the copy, the client will attempt the copy operation.
When the server copy fails but the client copy succeeds, CopyTable will fire an InfoMessage event (see AdsConnection.InfoMessage) with the information on why the copy could not take place on the server.
If strFile does not include a path, the current working directory will be used.