Crazy D @ Work
December 21st, 1999, 08:12 AM
Hi,
I'm trying to lock a record as soon as it's selected with an SQL query. I can lock when I update, but that's too late. It should be impossible for other users to select the record, even not for reading only. I tried several things I found in the SQL Server books online, using with (ROWLOCK) in the select query, but the only time it works is during an update.
All I read in newsgroups about this, is that it seems almost impossible to lock a row, without workarounds like adding a field with a username who's having the record, and besides, those are kinda buggy workaround IMHO.
Has anyone an idea how I can lock a record?
Oh, I'm using vb6-sp3, ado2.1 and sql server 7.
Tnx in advance!
Crazy D @ Work :-)
I'm trying to lock a record as soon as it's selected with an SQL query. I can lock when I update, but that's too late. It should be impossible for other users to select the record, even not for reading only. I tried several things I found in the SQL Server books online, using with (ROWLOCK) in the select query, but the only time it works is during an update.
All I read in newsgroups about this, is that it seems almost impossible to lock a row, without workarounds like adding a field with a username who's having the record, and besides, those are kinda buggy workaround IMHO.
Has anyone an idea how I can lock a record?
Oh, I'm using vb6-sp3, ado2.1 and sql server 7.
Tnx in advance!
Crazy D @ Work :-)