473,418 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

how to avoid user to access same Account?

how to avoid user to access same Account from diffrent location?
e.g There are 2 person A,B.They have joint account in bank
bank balance in their a/c is 5000. there must be a 1000
Rs. in their A/C if both A,B try to withdraw money 4000
at the same time from diffrent location how to give access to one usre at time othrwise they will withdraw 8000 Rs

if anybody have solution
please send me it on my email id:
*****************

thanx in advance
Oct 11 '10 #1
7 1336
Frinavale
9,735 Expert Mod 8TB
It might be a good idea to implement something at a database level that returns nothing if there is not enough money to withdraw.

-Frinny
Oct 12 '10 #2
Thanx but person B tries to withdraw amount before update
balance in their A/c. Both user has simaltenous access

will you please suggest me some code


****
Atul
Oct 12 '10 #3
Frinavale
9,735 Expert Mod 8TB
What database management system are you using?
I honestly think that this is best handled at the database level.

-Frinny
Oct 12 '10 #4
Well, You have to lock the table while User A is updating the value so once A is done then table is available for reading and B will get latest value.
Oct 12 '10 #5
sql server 2005
Oct 13 '10 #6
ck9663
2,878 Expert 2GB
It's called concurrency. Here, start from this...

Good Luck!!!

~~ CK
Oct 13 '10 #7
NeoPa
32,556 Expert Mod 16PB
Without wishing to distract you from reading the excellent piece linked by CK, one important basic point is to ensure that the checking of the available value, or current balance, is done at the point of attempted removal of funds, rather than simply checking prior to confirmation of the desire to update the balance. This can be done also, so that the operator knows not even to attempt the transaction, but this shouldn't be relied upon as there is obviously the possibility that the funds will have been removed between the time it was last checked and the confirmation of the desire to remove the funds is sent.

To put it into more standard SQL terms, it might go something like :
Expand|Select|Wrap|Line Numbers
  1. UPDATE [tblFunds]
  2. SET    [Value] = [Value] - 4000
  3. WHERE  ([ID] = {ClientID})
  4.   AND  ([Value] >= 4000)
Oct 14 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: David Wier | last post by:
I have a hosted account - I'm getting this error now..... Any reason that I can hunt down to figure out why I should be getting it?
3
by: canigou9 (remove your socks to reply) | last post by:
(cross posted - comp.databases.ms-access, microsoft.public.access) Hello folks - this is my first post here, after a short lurk. I have written an application in Access2002 for a friend's...
5
by: premmehrotra | last post by:
I currently have a multi-user access database which is put on a shared drive L: on a Windows Servers. Entire database is one file premdb.mdb. Users access this database from their laptops....
6
by: Nicky | last post by:
hi,all We are going to develop a program and when it is running, we need it full screen and also, user can not switch to other place before exit our program. I am thinking, we can make a window...
1
by: Nasser | last post by:
Hello, I am coding a mathematical model with VC++. When I debug the code, I face with no erroe, but during executing, I face with below error "Unhandled exception at 0x0040c275 in Tar.exe:...
0
by: Bruce Pataki | last post by:
I am creating an MFC application with activeX document server support. The application runs perfectly fine when i run as a standalone application. But when i run the application in Internet...
1
by: chiranjiv choudhary via .NET 247 | last post by:
Can we have CodeBehind file in another server or same machine but diffrent location or directory -------------------------------- From: chiranjiv choudhary ----------------------- Posted by a...
2
by: bhreddy | last post by:
Hi All, Can someone help me out how can I resolve the error "0xC0000005: Access violation reading location 0x513112f4"? Steps I followed... 1. I ran the application at DOS prompt 2. After...
1
by: =?Utf-8?B?c2F0aGVlc2t1bWFy?= | last post by:
In my project i have a component named PTS Engine which is developed in VC++ ..Net 2003. And it is migrated to VC++.NET 2005 version. Initially this migration process has coded and tested in VC++...
13
by: ycinar | last post by:
A quick question: Why doesn't the following code catch the Access violation reading location exception? it crashes on line if ( xyz ) with an Access violation reading location exception. Is not...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.