Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CursorSetProp() Questions

Status
Not open for further replies.

Mickbw

Programmer
Jul 9, 2001
84
US
Hi,

I am using free tables for my application rather than a database. I need to incorporate Multi-User support into the application and have a few questions:

Can I do
CursorSetProp("Buffering", 5, EachTableName)
in a startup program for each table.

Help states that "Buffering is not applied to tables that are opened implicitly, for example, using SQL INSERT/UPDATE/DELETE commands." If buffering was set as I hope I can in the earlier example, would I then need to implicitly shut down the updated table before buffering would work on that table.

Thanks for all your help,

Mickbw
 
Yes, you can use CURSORSETPROP to set the buffer mode for free tables. But you say "in a startup program for each table". Keep in mind that if you want to use private datasession in your forms (which is a good idea), then you want to do this in each form, and not in a startup program. Although you can open all the tables in a startup program to speed up opening them in forms, you'll want to open them again and set their buffer mode in each form.

If you do have tables opened by SQL commands, you can change their buffer mode after they're opened without having to close them--if you want to. That's not always desireable. For example, if you're using a view, it will be buffered, but the source table(s) will not be. If you then change the source table(s) to be buffered, you'd have to use two TABLEUPDATE commands to write the data back to the source tables instead of one.



-BP
 
Thanks for the quick reply,

That makes sense. I was just being lazy.

In my code (which I inherited) nothing is set to a private data session. I believe all I have to do is set the data session property for each form to Private Data Session, Right?

That shouldn't be a problem since I am not using a database, should it?

Mickbw
 
Hi Mikebw,

The data sessions are just environment. When it is private, for one form, the forms work areas are separate from the other forms that might be opened or some other prg running side by side in another private or public environment.

Database or standalone table is a property of the table. Irrespective of DBC or free table, the private datasession helps to see the tables as its private work areas.

With private Datasession in 2 forms..
Form1 can have table1 and the record pointer located at nn record number. Form2 can have the same table again with same alias name with some other index order and with its own record location at nx record number. They can coexist without creating the problem. In a default data session, if you move the record pointer in form2, the form1s record location gets changed and you have to ensure that such changes are proprly reflected in your form.

Buffering is like cacheing and is different from the above.

Hope that helps you understand. :)


____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
I believe all I have to do is set the data session property for each form to Private Data Session, Right?

Correct, however, it's really best if all of your forms inherit from your own form class, so you only have to change this in one place.



-BP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top