18.01.2013 Views

Visual Basic 6 Client/Server Programming Gold Book:Table of ...

Visual Basic 6 Client/Server Programming Gold Book:Table of ...

Visual Basic 6 Client/Server Programming Gold Book:Table of ...

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.

update statement sent to the database. Normally, you only need to specify the primary key in<br />

the WHERE clause to uniquely identify the row to be updated. However, in a multiuser<br />

environment, you might want to include more columns to ensure that no other user has<br />

altered the record between the time you retrieved the row and the time you update it. For<br />

instance, if you specify your WHERE clause, include all columns from the record; then if<br />

the WHERE clause fails, you know that the record has been altered. Use dbCriteriaKey if<br />

you only want to use the primary columns in the WHERE clause. dbCriteriaModValues<br />

causes the WHERE clause to include the primary columns and any columns that were<br />

changed. Use this option if you are concerned about concurrency issues (see Chapter 11 for<br />

more details) but only care about those columns that you altered. dbCriteraAllCols uses all<br />

columns in the WHERE clause. Use this option in a multiuser environment where you<br />

absolutely do not want to alter a record if another user has altered it. dbCriteriaTimeStamp<br />

will use the primary columns and the timestamp column if there is one. This is <strong>of</strong>ten just as<br />

good as dbCriteriaAllCols because any change to the record will cause the timestamp to be<br />

changed, and it is more efficient (because the WHERE clause is simpler). Along with any<br />

<strong>of</strong> the five prior constants, you can also specify either dbCriteriaUpdate to specify that the<br />

update be done with an UPDATE statement or dbCriteriaDeleteInsert to specify that the<br />

update be done by first deleting the record and then inserting a new one. Normally, you will<br />

want to use dbCriteriaUpdate (which is the default) because it is inherently more efficient.<br />

However, if for some reason you are altering the primary key, you normally need to delete<br />

the first record and then insert a new record.<br />

• The ValidationRule and ValidationText properties (Jet workspace only) control the<br />

validation criteria and what message to display if the record fails validation. I generally<br />

recommend validating each field in the RecordSet independently. Note, however, that the<br />

ValidationRule for a Field object cannot reference other Field objects, whereas the<br />

ValidationRule for a RecordSet can reference any field in the record. I discussed these<br />

properties earlier in the chapter in the <strong>Table</strong>Def and Field topics.<br />

Products | Contact Us | About Us | Privacy | Ad Info | Home<br />

Previous <strong>Table</strong> <strong>of</strong> Contents Next<br />

Use <strong>of</strong> this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.<br />

All rights reserved. Reproduction whole or in part in any form or medium without express written permission <strong>of</strong> EarthWeb is<br />

prohibited. Read EarthWeb's privacy statement.

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

Saved successfully!

Ooh no, something went wrong!