Roni Sutton
Registered User.
- Local time
- Today, 00:36
- Joined
- Oct 18, 1999
- Messages
- 68
I am using Rumba Object X in a VB executable to hit an Access 97 db. We have a mainframe based loan system from wence we basically copy information into the various fields in the database. The problem is that when multiple users are performing the function of 'scraping' the data from the mainframe into the table we get record locking errors on the update line of the recordset after the addnew. I am using ado so my code looks like this:
dim rshistory as New ADODB.Recordset
dim historysql as string
historysql = "Select * from tblHistNew"
rshistory.Open historysql, gcn, adOpenDynamic, adLockPessimistic
rshistory.addnew
rshistory![loannum] = gscr(22, 12, 10)
rshistory![amt] = gscr(20,3,8)
rshistory.update
gscr is a user defined function that gets the data from the screen. The first number is the row, the second the column and the third the length of the data to put into the recordset field. When it dies, the rshistory.update line is highlighted and I get a run time error that generally says something like "Record is locked by user 'admin' on machine 2du945720."
Is there a better way to open the record set so that multiple people can add records to the table at the same time without causing a conflict? Is my generic SQL Select statement the best way to reference the table or is there a better way? Would using the Insert INTO statement work better rather than opening the recordset and using addnew? I hate to go through and re-do all this code unless I have to because it's monstrously large. I'm really hoping this is something obvious that I'm just overlooking.
(I've also tried opening my recordset as follows:
rshistory.Open historysql, gcn, adOpenKeySet, adLockOptimistic)
PLEASE HELP - the users are about to lynch me.
Roni
dim rshistory as New ADODB.Recordset
dim historysql as string
historysql = "Select * from tblHistNew"
rshistory.Open historysql, gcn, adOpenDynamic, adLockPessimistic
rshistory.addnew
rshistory![loannum] = gscr(22, 12, 10)
rshistory![amt] = gscr(20,3,8)
rshistory.update
gscr is a user defined function that gets the data from the screen. The first number is the row, the second the column and the third the length of the data to put into the recordset field. When it dies, the rshistory.update line is highlighted and I get a run time error that generally says something like "Record is locked by user 'admin' on machine 2du945720."
Is there a better way to open the record set so that multiple people can add records to the table at the same time without causing a conflict? Is my generic SQL Select statement the best way to reference the table or is there a better way? Would using the Insert INTO statement work better rather than opening the recordset and using addnew? I hate to go through and re-do all this code unless I have to because it's monstrously large. I'm really hoping this is something obvious that I'm just overlooking.
(I've also tried opening my recordset as follows:
rshistory.Open historysql, gcn, adOpenKeySet, adLockOptimistic)
PLEASE HELP - the users are about to lynch me.
Roni
Last edited: