multiple users gain data access in the same time..

tommyboy

Active member
Joined
Jun 21, 2005
Messages
34
Programming Experience
Beginner
multiple users gain data access in the same time..[RESOLVED, THNX TO KULROM]

hello ther...
plz anyone help me solve tis annoyin prob!

i hv created a system in vb.net using sql server 2000 as backend..
ma prob is tat wen tat particular system can b installed in many different pcs' n if they try access to t database in t same time under same company details then i should let them gv options either wait till the 1st user finishes his/hers job get done or quit!

but my current system can allow many users can access in t same time n im afraid tat latter crashin in database level or in prog level tat might occur!!

plz sum1 save me from tis major prob!!!
:confused: :confused: :confused: :confused: :confused: :confused:
 
Last edited:
I'd resolve it as it follows:

  • Create an additional table and name it "tempLogged" (create fields: IP & forms)
  • When first instance of your app starts make it to report its entrance (handshaking) writting i.e. IP address
  • Now if user get open a form "invoice" for instance also send notice about that into DB (field forms) writting name of the form
  • If user from another computer try to open "Invoice" form it should be disabled. Means if form "invoice" is listed there (use a query to fetch all active forms) user will not be able to open this form.
  • Delete all entries from tempLogged that certain instance has done (using IP address as condition)
That's it ... happy coding
icon14.gif
 
dear kulrom,

correct me if im wrong...

is tat yer suggesting i can do tat...

~ 1st create a table called tempLogged with primaryID, IPinfo, logIncompName, username

~ n then for everytime i run login form, i gathert info on which ip n tryin log in into which company n store them under tempLogged table...

~ n checked immedietly tat how many times occurence of tat company name n username on tat table n

~n if same userName or company appeared to b more then once then i shal denied the particular user's access n promt message to inform tat either "u hv already logged" in if same username appear more then once or "another user hv logged in for tat company if same company exist more then once"...


is tis all wat yer suggestin..

plz respon me ASAP..

realy appreciated pal!
 
Ok, it definetly seems like I have missunderstood your question. But, anyway i was very close there. Namely, i thouht that u want to preserve occurences like ones that when two people from two different computers get try to make an invoice and they have grabbed/reserved the same invoice's No. that would bring later issues (i suppose u know what i mean) ... that's what i thought. However, the scenarion that u described above seems just fine to me. Give it a try and let me know if you need an assistence

Regards ;)
 
Dear kulrom,

wel i hv tried this method n i hv successfully can stop the multiple access to the same account with same company name,,,

but ther is one major prob has risen from this method..

whereby...wen everytime t user log out i can delete his details from the tempLog table...but how if wen a user succesfully made access to t system n wen he close tat application without using the logout method like he juz straight away close the whole application by press the cross button on top or tru option "Exixt" from main menu..coz i din write any code to delete the info bot current log in user's wen he halt from t system alternatively by exit from the system..

do u hv any idea how to overcum tis..

is tat any code for to identify when t system quit from tat particular cross button or exit the system by "Alt+F4" then i shal delete the current loggin info from the table as well....

ur help is highly appreciated!
 
erm..
haha i noe tat acc but juz din noe how to write code on tat..
wel im too new for tis language man..
erm..
izzit sumthin like?

if application.state.close
deleteTempLog() ' this function will delete all the current login details.. ;^D
end

can u help me direct t way to identify when is t app close state by write me t code if can
:)

thnx man n realy owe u a lunch :p...haha
 
VB.NET:
VB.NET:
[COLOR=#0000ff]Private [/COLOR][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] Form1_Closing([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Object[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.ComponentModel.CancelEventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]MyBase[/COLOR][/SIZE][SIZE=2].Closing[/SIZE]
 
[SIZE=2][COLOR=darkgreen]'here put the query that deletes the entries[/COLOR][/SIZE]
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]


Regards ;)
 
hmm..so tats way closin form..haha
m realy very fresh in this..looks so obvoius..

realy thnx lot man...

rgds
dave oneal :cool:
 
Back
Top