Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / December 2007



Tip: Looking for answers? Try searching our database.

ADO Record Set in Multi User Mode

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Wong - 14 Dec 2007 05:59 GMT
Hi All,

Can any body help me to use the ADO Recordset in Multiuser Environment for
SQL Server DB?

How Can I Restrict User 2 to Open the Same Row which is Opened By User 1 and
I will Display Message that "This Record is being opened for edit"?

Suppose User 1 Open a ROW using SQL "Select * from EMP Where EMPID = 1001".
So Now User 2 Should not be able to use the 1001 Employee. If He Try to open
that then he should get the Above message. But he should be able to open any
other records. And Also When the User 1 will Say "Update" or "Cancel" then
the user 2 should be able to open 1001.

I am New to Multiuser programming in ADO. Please Guide me.

Thanks
Peter
Jan Hyde (VB MVP) - 14 Dec 2007 09:10 GMT
"Peter Wong" <thebeeshop@yahoo.com.NOSPAM>'s wild thoughts
were released on Fri, 14 Dec 2007 13:59:35 +0800 bearing the
following fruit:

>Hi All,
>
[quoted text clipped - 6 lines]
>Suppose User 1 Open a ROW using SQL "Select * from EMP Where EMPID = 1001".
>So Now User 2 Should not be able to use the 1001 Employee.

Actually he should, since user 1 is not using that record.
User1 should lock that record, then when user 2 tries to
lock it, it wail fail as the record is already locked and
you can warn user 2.

>If He Try to open
>that then he should get the Above message. But he should be able to open any
>other records.

And he will providing a single row can be locked, assuming
EMPID is a unique index this wouldn't be a problem.

> And Also When the User 1 will Say "Update" or "Cancel" then
>the user 2 should be able to open 1001.
>I am New to Multiuser programming in ADO. Please Guide me.

Take a look at transactions.

--
Jan Hyde

https://mvp.support.microsoft.com/profile/Jan.Hyde
Peter Wong - 15 Dec 2007 02:03 GMT
Thank you vey much Jan Hyde.

Regards,
Peter

> "Peter Wong" <thebeeshop@yahoo.com.NOSPAM>'s wild thoughts
> were released on Fri, 14 Dec 2007 13:59:35 +0800 bearing the
[quoted text clipped - 33 lines]
>
> https://mvp.support.microsoft.com/profile/Jan.Hyde
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.