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

VB + Access Options

Status
Not open for further replies.

kovas

Technical User
Aug 6, 2002
88
US
When I open my access database in vb, how do I set the options Default Record Locking = Edited Record and Number of Update Retries = 0 ?

DBConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database.mdb;Persist Security Info=False"


thanks
 
Hi,
Are you still interested in doing this? If yes, here is some code to help you. Be aware that when you open a database, an object is created automatically for you. This is the "application" object. You may want to create a new module, then insert a public sub procedure:

' show the current default record lock
' values are: 0 (zero) NO LOCKS
' 1 All records
' 2 Edited record
Dim varLocking As Variant
varLocking = Application.GetOption("Default Record Locking")
MsgBox varLocking

' let's change it to NO LOCKS
Application.SetOption "Default Record Locking", 0
varLocking = Application.GetOption("Default Record Locking")
MsgBox varLocking

You can find more info on the various options at this Microsoft web site:
HTH,
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top