To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Database Development

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Feb 6th, 2007, 04:50 AM   #1
nasreen
Lively Member
 
Join Date: Apr 05
Posts: 69
nasreen is an unknown quantity at this point (<10)
Update a record by multiple users at a time

Hi,

I have a project for a money transfer compnay in VB6 and MS SQL 2000 and there are more than 20 Users working on the same project
In one of my table there is a record to be updated by all users.

I am using the following code

"update LCStockMS set Month2 = " & StAmt & " where On_Year = '2007' AND C_Code = 'EBL' "


Where StAmt is the amount to be settled to the currespondent on each transactions

But I got wrong value when multiple users doing at a same time.

So any body can suggest a solution to clear this problem

With regards,
Nasreen
nasreen is offline   Reply With Quote
Old Feb 6th, 2007, 04:54 AM   #2
moinkhan
Frenzied Member
 
moinkhan's Avatar
 
Join Date: Jun 00
Location: Karachi, Pakistan
Posts: 2,011
moinkhan  is on a distinguished road (40+)
Re: Update a record by multiple users at a time

Quote:
Originally Posted by nasreen
Hi,

I have a project for a money transfer compnay in VB6 and MS SQL 2000 and there are more than 20 Users working on the same project
In one of my table there is a record to be updated by all users.

I am using the following code

"update LCStockMS set Month2 = " & StAmt & " where On_Year = '2007' AND C_Code = 'EBL' "


Where StAmt is the amount to be settled to the currespondent on each transactions

But I got wrong value when multiple users doing at a same time.

So any body can suggest a solution to clear this problem

With regards,
Nasreen
Maybe record is locked by someone... and some of the users are not able to update the record..
__________________
GOD is One.
MCP,SCPJ2,CCNA
Have I helped you? don't say thanks,
Just give me reputation points. Can see beneath my avatar? ...

My Utilities with code
Extended Form Events Control
I am a hard worker, i hardly work
moinkhan is offline   Reply With Quote
Old Feb 6th, 2007, 08:06 AM   #3
szlamany
MS SQL Powerposter
 
szlamany's Avatar
 
Join Date: Mar 04
Location: CT
Posts: 12,269
szlamany is a name known to all (1000+)szlamany is a name known to all (1000+)szlamany is a name known to all (1000+)szlamany is a name known to all (1000+)szlamany is a name known to all (1000+)szlamany is a name known to all (1000+)szlamany is a name known to all (1000+)szlamany is a name known to all (1000+)szlamany is a name known to all (1000+)szlamany is a name known to all (1000+)
Re: Update a record by multiple users at a time

20 users should never be trying to update the same record at the same time.

You should architect your table structure to avoid this.

20 users should be only, ever, inserting new records into a table. That's the way a multi-user system should be designed.

That "insert only" table should have probably an identity column as the PK.

Then you use SELECT SUM(...) FROM ... GROUP BY statements to aggregate activity on that table.

Are you reading the amount into VB and then modifying it in VB then attempting to re-update that value - with 20 users doing this concurrently??

Please explain what's happening prior to the update and what your end-goal is.
__________________

*** Read the sticky in the DB forum about how to get your question answered quickly!! ***

Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

Some Informative Links:
[ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
[ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ VB.Net Database Class ] [ Loading Pictures from DB ]


MS MVP 2006, 2007, 2008
szlamany is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Database Development


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:25 AM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.