Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

Record Locking - Against SQL Server

I'm using VB6 against an SQL Server 7 database.
I'm having trouble coding for a case where more than one user is accessing the same record.
If a user makes changes to the record and saves the record, the record should be saved and refreshed on the server.
The application consists of a datagrid in which the user can double-click on a record in the grid to make changes.
Then, a form is brought up to allow the user to make changes.
The way the code is written now is this:
After the user exits the form after having made changes, I run the same sql statement again to refresh and populate the grid.
But, this isn't working.
The update is only working on the machine where the user made the changes.
On other client computers accessing the grid at the same time, the changes aren't updated.

Is there some sort of commit I need to make to save all of the changes up-to-the-minute?

Thanks in Advance
John
0
jtrapat1
Asked:
jtrapat1
1 Solution
 
Anthony PerkinsCommented:
Are you using the ADO Data Control?  If so, this might explain the problem.

Anthony
0
 
inthedarkCommented:
There is an issue here with the way that multiple users are responsible for the same data.  What type of application is it? Could the user's responsibilities be divided?
0
 
dgorinCommented:
You could try a CursorType property of 2 in your ADODC or the code that opens your recordset.  If you're using ADO, anyway.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jtrapat1Author Commented:
I'm not using the ADO data control.
I'm using a recordset as a data source for the datagrid and it's still not updating for each concurrent user.

This is a client-server application.


0
 
jtrapat1Author Commented:
I'm not using the ADO data control.
I'm using a recordset as a data source for the datagrid and it's still not updating for each concurrent user.

This is a client-server application.


0
 
barendbCommented:
You need to requery all users' recordsets periodically, because they will only see data up to the last change that they have made.  Try the following, update a record on one user's machine, save changes.  Now update another record on another user's machine and save the changes, you should be getting botth changes back on the second machine, because you requery after the update.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now