Solved

Unlock records

Posted on 2002-04-18
1
924 Views
Last Modified: 2013-12-25
i am developing a VB6 application connecting to ORACLE 8.0. database. i have a question, how can i unlock a record without disconnecting?

  the problem is like this. i make a connection to the database when the user start the app. when the user open a form, i lock a certain record so others won't be able to change the record by using "SELECT .... FOR UPDATE". so if the user opened more than 1 forms, i would have lock a few records using the same connection. when the user exit a form, i would like to unlock the record that was previously locked by this form without unlocking the other records.

  Are there anyway i can do this without disconnecting or issuing a BeginTrans/RollbackTrans? thanks
0
Comment
Question by:max1978ex
1 Comment
 
LVL 18

Accepted Solution

by:
mdougan earned 50 total points
ID: 6950716
I'd have to see your syntax for issuing the select for update statement.

Most people simply open a recordset that is updateable, and then start changing values in a particular record.  If you have set a Lock type of Pessimistic, then it will automatically lock the record.  I think that there is a recordset CancelEdit method you can call to cancel edit mode on the current record.  Under DAO, you explicitly had to say RS.Edit and then RS.Update, but if you wanted to cancel the edit you'd just issue a second RS.Edit statement.

In your case, if you are opening a Recordset for each record that you are "locking" then closing the recordset should cancel any changes you've made, as long as you haven't issued an RS.Update statement, without it being necessary for you to close the connection.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question