Visual FoxPro Developer Center >
Visual FoxPro Forums
>
Visual FoxPro General
>
multiuser environment
multiuser environment
- How do I open and close tables for a multiuser environment in vfp 9.0? I don´t use tableupdate() commands. I use update and insert commands to record data. I need to know how to control this.
Answers
How do I open and close tables for a multiuser environment in vfp 9.0? I don´t use tableupdate() commands. I use update and insert commands to record data. I need to know how to control this.
You should.You would simply use CursorSetProp('Buffering', 5, 'yourAlias') to turn table level optimistic buffering on.Here is a very simple single form multiuser application:public loFormloForm = createobject('myForm')loForm.Show()read eventsdefine class myForm as FormDataSession = 2 && private data sessionControlBox=.f.Add object btnSave as CommandButton with caption = 'Save', Width = 60Add object btnClose as CommandButton with caption = 'Exit', Left = 70Add object grdCustomers as Grid with RecordSource = 'Customer'Procedure Loadset exclusive offuse (_samples + 'data\Customer')CursorSetProp('Buffering', 5, 'Customer')endprocProcedure btnSave.Clicktableupdate(2,.t., 'Customer')endprocprocedure btnClose.Clickclear eventsthisform.release()endprocenddefinePS: This is very simple. Read "programming for shared access" section in help. You would need to handle updates differently under different usage scenarios. What I wrote is known as "last write wins" and may not be appropriate for your scenario.- Marked As Answer byMartin Xie - MSFTMSFT, ModeratorTuesday, November 10, 2009 6:08 AM
All Replies
- Check below Link..http://www.foxite.com/articles/read.aspx?id=75&document=moving-from-single-user-to-multiuser-in-vfp
Please "Mark as Answer" if this post answered your question. :)
Kalpesh Chhatrala | Software Developer | Rajkot | India
Kalpesh's Blog - Just put in init event of you main form or at beginning of your mai program SET EXCLUSIVE OFF AND SET MULTILOCKS ON..
dni I understand that for a mutiuser environment I need to put my dataenvironment tables in buffering #5 optimistic table. When i do this my forms open well for mutiuse but my data doesn´t record. I use the update command and insert command. Also i don´t understand how other forms open well after this and the tables aren´t buffered to optimistic table. Confused is what I am, help me please.
- Merged byMartin Xie - MSFTMSFT, ModeratorThursday, November 05, 2009 3:15 AMMerge it to keep them in the same topic.
- You may need to use tableupdate() to update buffered tables ...
dni How do I open and close tables for a multiuser environment in vfp 9.0? I don´t use tableupdate() commands. I use update and insert commands to record data. I need to know how to control this.
You should.You would simply use CursorSetProp('Buffering', 5, 'yourAlias') to turn table level optimistic buffering on.Here is a very simple single form multiuser application:public loFormloForm = createobject('myForm')loForm.Show()read eventsdefine class myForm as FormDataSession = 2 && private data sessionControlBox=.f.Add object btnSave as CommandButton with caption = 'Save', Width = 60Add object btnClose as CommandButton with caption = 'Exit', Left = 70Add object grdCustomers as Grid with RecordSource = 'Customer'Procedure Loadset exclusive offuse (_samples + 'data\Customer')CursorSetProp('Buffering', 5, 'Customer')endprocProcedure btnSave.Clicktableupdate(2,.t., 'Customer')endprocprocedure btnClose.Clickclear eventsthisform.release()endprocenddefinePS: This is very simple. Read "programming for shared access" section in help. You would need to handle updates differently under different usage scenarios. What I wrote is known as "last write wins" and may not be appropriate for your scenario.- Marked As Answer byMartin Xie - MSFTMSFT, ModeratorTuesday, November 10, 2009 6:08 AM


