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

ADO, Access2000 database, and Locking problems

Status
Not open for further replies.

Perogy

Programmer
Dec 5, 2000
6
CA
Hello:

I am having problems with VB6(SP3) and ADO using an Access 2000 database. I cannot seem to have >1 user in certain forms of my system at once, or I get various errors when users update the database (thru that form)

I'm using the DataEnvironment to open the recordsets.

I'm not sure how ADO is locking the records, if it is at all! I have tried setting the Lock Type to Optimistic and Pessismistic, but same results.

I'm used to the DAO method of catching the error if the record is locked:

** example ***

On Error GoTo ErrorHandler
Datacontrol.Recordset.Edit
' modify code here
Datacontrol.UpdateRecord ' save the data

exit sub

ErrorHandler:

If Err.Number = 3260 Then
MsgBox "This Record Is Locked By Another User - Please Try Again Later", vbExclamation, "Data is Locked"
End If

** end example **********

Question:
What is the proper method for locking records using the DataEnvironment and ADO on an Access 2000 DB ?

All comments appreciated...

Darryl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top