12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

462 Day 12<br />

statements are executed <strong>in</strong> the l<strong>in</strong>ked UpdateSQL component. Note that you can set up the<br />

OnUpdateError event to handle errors that occur dur<strong>in</strong>g a call to ApplyUpdates.<br />

There are also a couple properties that relate directly to the use of cached updates with stored<br />

procedures: CachedUpdates and UpdateRecordTypes. CachedUpdates toggles cached update<br />

support for the StoredProc component. Unless CachedUpdates is enabled and you’ve l<strong>in</strong>ked<br />

and set up an UpdateSQL component properly, you won’t be able to update stored procedure<br />

result sets. UpdateRecordTypes determ<strong>in</strong>es which types of updates rema<strong>in</strong> visible <strong>in</strong> a TDataset<br />

with CachedUpdates set to true.<br />

Updat<strong>in</strong>g read-only TDatasets is discussed further <strong>in</strong> the section on the UpdateSQL component<br />

later today.<br />

TBatchMove<br />

Module: DBTables Class ancestor: TComponent<br />

The TBatchMove component enables you to work with sets of records <strong>in</strong> operations between<br />

two tables. These sets can range from a few records to all the records <strong>in</strong> a TDataset. When<br />

work<strong>in</strong>g with TBatchMove, you specify both a source and a dest<strong>in</strong>ation table. You can append,<br />

update, and delete rows <strong>in</strong> the target table. You can even replace the target table completely<br />

if you want to. The actual operation carried out when you call the component’s Execute<br />

method depends on the sett<strong>in</strong>g of the Mode property.<br />

Table 12.17 lists the key properties and Table 12.18 lists the key methods of the TBatchMove<br />

component. This component has no key events.<br />

Table 12.17. TBatchMove key properties.<br />

Property Description<br />

Dest<strong>in</strong>ation Specifies the dest<strong>in</strong>ation of the batch move operation.<br />

Mapp<strong>in</strong>g Specifies column-to-column mapp<strong>in</strong>gs between Source and Dest. If<br />

your source and dest<strong>in</strong>ation tables are not identical, you’ll need to<br />

provide field mapp<strong>in</strong>gs so that the BDE can figure out where to put<br />

your data. If you neglect to do this with tables that aren’t identical,<br />

the batch move will fail.<br />

Mode Specifies the type of move (such as batAppendUpdate or batCopy).<br />

Source Specifies the source of the batch move operation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!