Optimistic Locking in VB with Stored procedures 
Author Message
 Optimistic Locking in VB with Stored procedures

Hi everyone

I am developing in VB and SQL Server 7 and need to find out whether
there is any way that I can use optimistic locking using stored
procedures and effectively off-line processing.  I have managed to get
the timestamp value into VB as a char and was thinking that I could
convert it into BINARY in a stored procedure, but this don't seem to be
working.

Is there any good method for getting timestamps to and from Visual
Basic, or is there a better way in which to do it?  If anyone can help
I'd be really grateful as I'm getting a little stressed with it.  

Any help appreciated

Cheers

Steve Pillings



Fri, 04 Jan 2002 03:00:00 GMT  
 Optimistic Locking in VB with Stored procedures
We store timestamp's in Variant data types.


Quote:
> Hi everyone

> I am developing in VB and SQL Server 7 and need to find out whether
> there is any way that I can use optimistic locking using stored
> procedures and effectively off-line processing.  I have managed to get
> the timestamp value into VB as a char and was thinking that I could
> convert it into BINARY in a stored procedure, but this don't seem to be
> working.

> Is there any good method for getting timestamps to and from Visual
> Basic, or is there a better way in which to do it?  If anyone can help
> I'd be really grateful as I'm getting a little stressed with it.

> Any help appreciated

> Cheers

> Steve Pillings



Fri, 04 Jan 2002 03:00:00 GMT  
 Optimistic Locking in VB with Stored procedures
don't bother trying to work with timestamps in VB if you are trying to
control concurrency issues with users overwriting each others changes.
the best way is to create your own concurrencyID field in every table
and have your update sp's check the value to see if it's been
incremented or not. if the value in the table matches the value in the
recordset, your update sp increments the concurrencyID value at the
same time it updates the other fields. if not, it returns an error
code, which you can then program around. handling the issue yourself
is the only way to safely deal with concurrency issues. if you're
trying to do something else entirely, then post more details.

On Mon, 19 Jul 1999 17:41:41 +0100, Steve pillings

Quote:

>Hi everyone

>I am developing in VB and SQL Server 7 and need to find out whether
>there is any way that I can use optimistic locking using stored
>procedures and effectively off-line processing.  I have managed to get
>the timestamp value into VB as a char and was thinking that I could
>convert it into BINARY in a stored procedure, but this don't seem to be
>working.

>Is there any good method for getting timestamps to and from Visual
>Basic, or is there a better way in which to do it?  If anyone can help
>I'd be really grateful as I'm getting a little stressed with it.  

>Any help appreciated

>Cheers

>Steve Pillings



Fri, 04 Jan 2002 03:00:00 GMT  
 Optimistic Locking in VB with Stored procedures
thanks for this - I guessed that timestamp concurrency was not that easy -
oh well.  Maybe in the future??

Thanks for that.  I owe you one

Steve

Quote:

>don't bother trying to work with timestamps in VB if you are trying to
>control concurrency issues with users overwriting each others changes.
>the best way is to create your own concurrencyID field in every table
>and have your update sp's check the value to see if it's been
>incremented or not. if the value in the table matches the value in the
>recordset, your update sp increments the concurrencyID value at the
>same time it updates the other fields. if not, it returns an error
>code, which you can then program around. handling the issue yourself
>is the only way to safely deal with concurrency issues. if you're
>trying to do something else entirely, then post more details.



Sat, 05 Jan 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Add a new item also locked with optimistic locking

2. Timestamp datatype and VB - optimistic lock

3. To Stored Procedure or not to stored procedure

4. To stored procedure or not to stored procedure

5. sub report changes its source stored procedure to main report's stored procedure

6. To stored procedure or not to stored procedure

7. ado recordsets from stored procedures, stored procedures have input parameters

8. Optimistic Lock: No Error Adding New Record

9. Optimistic Locking and Write Conflict Errors

10. Optimistic Record locking (networked Database)

11. Re : Error 3186 on Optimistic Locking

12. Error 3186 on Optimistic Locking

 

 
Powered by phpBB® Forum Software