Click to See Complete Forum and Search --> : Mode Property for Connection Object


comart
July 6th, 2001, 07:59 AM
When using the mode property of the connection object, what does the word Share mean in some of the enum constants? For example, what does the Share mean in the enum adModeShareDenyRead.

ENUM Examples:
adModeReadWrite
adModeShareDenyNone
adModeShareDenyRead

dfwade
July 6th, 2001, 08:10 AM
The mode property indicates the available permission for modifying data.
adModeUnknown - Permission can not be determined
adModeRead - read only
adModeWrite - write permission
adModeReadWrite - read/write permission
adModeRecursive - adShare permission applied recursively
adModeShareDenyRead - Prevents others from opening a connection in read mode
adModeShareDenyWrite -Prevents others from opening a connection in write mode
adModeShareExclusive - prevents other from opening a connection
adModeShareDenyNone - no permissions denied

-Not all OLE DB providers support all modes

comart
July 6th, 2001, 08:39 AM
I know what HELP says, but I do not understand these definitions. What does SHARE do for me?

dfwade
July 6th, 2001, 09:09 AM
you would set the mode property of the connection object under very specific conditions. For Example: You are performing an update to a table that must complete without contention from any other users. In this case you would use the adModeShareDenyWrite to exclude other users from writing to the database until you are finished updating the database. Another Example: You want to compress or copy the database in code, you need to lock all other users out of the database until you are done - adModeShareExclusive. The other use for the mode property is if you have a user that is only supposed to have read permission then use adModeRead to prevent any writes going back to the database