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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table buffering mode?

Status
Not open for further replies.

august

MIS
Aug 24, 2000
150
PH
How can i escape to this error?
"Function requires row or table buffering mode"
what is the proper way of doing it?
thanks!

august [sig][/sig]
 
august

There could be various reasons why you are getting ths error.

Best practice is to open ALL tables in project at start, using IN 0 argument. This code follows your USE ... IN 0 statements.

The following code is for a single user machine

SET MULTILOCKS ON
FOR lnTableNo = 1 TO 32767
[tab]IF !EMPTY(SELECT(lnTableNo)) && Checks for open tables
[tab][tab]SELE (lnTableNo)
[tab][tab]REIN && Optional
[tab][tab]lcCurrentAlias = ALIAS()
[tab][tab]CURSORSETPROP([Buffering],5,(lcCurrentAlias))
[tab]ELSE
[tab][tab]EXIT
[tab]ENDIF
ENDFOR
* Application runs
*
*
TABLEUPDATE(.T.,.T.,[FILENAME]) && Update as required
*
*
* This code needs to be at end of MAIN in CLEANUP prcedure
FOR lnTableNo = 1 TO 32767
[tab]IF !EMPTY(SELECT(lnTableNo)) && Checks for open tables
[tab][tab]SELE (lnTableNo)
[tab][tab]lcCurrentAlias = ALIAS()
[tab][tab]TABLEUPDATE(.T.,.T.) && Updates all tables
[tab][tab]CURSORSETPROP([Buffering],1,(lcCurrentAlias)) && Remove buffering
[tab]ELSE
[tab][tab]EXIT
[tab]ENDIF
ENDFOR

SET MULTILOCKS OFF
* Other cleanup code
QUIT

If this code does not resolve the problem, please advise

Chris [sig][/sig]
 
Do you have the VFP Programmers Guide or help file? It gives a very good example of using TableUpdate. I'm assuming you attempted a TableUpdate on a nonbuffered table(s) [sig]<p>John Durbin<br><a href=mailto: john@johndurbin.com> john@johndurbin.com</a><br><a href= </a><br>ICQ #9466492<br>
ICQ VFP ActiveList #73897253[/sig]
 
If the table was opened by a form, you can set this property on the form-level and it will apply to all forms opened by it.

I wouldn't venture any further until you read up on buffering and gain an understanding of why you'd want it. Otherwise, you'll be frustrated when data doesn't save when you want it to, or does save when you don't.

Chris, I don't know about opening all tables at program start. This opens them up to corruption, and uses system resources that may never be called upon. For a small system, I agree; but with a system of 30+ tables, some which may never be used within a session, it would seemingly harm performance. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Robert

The use of the term &quot;best practice&quot; was too emphatic, and should have been qualified.

As a practising pragmatist, I find if they are all open from the start, you can simply forget them and concentrate on other issues.

Chris [sig][/sig]
 
That is true, and I reiterate that, for a system of a practical size, opening them all at the start is the easiest way to go.

I'm probably a bit myopic now; every system I've worked on lately uses private data sessions, or has 100+ tables, or is client-server.... [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
thanks for the responses! any suggestion on what books is a good reference on a beginner like me? Thanks again!

august [sig][/sig]
 
august

Unable to answer your query, but the massed intellect and experience gathered here at this particular watering hole could probably produce the definitive guide to Visual FoxPro.

Save your money and keep asking the questions, no matter how simple.

We were all beginners once and we can all learn from the discussions.

Chris [sig][/sig]
 
Thanks all guys! i'm happy to be a member of this forums!
thanks again.

august [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top