Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Safe Table Opening Code -How's This?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Safe Table Opening Code -How's This?
Miscellaneous
Thread ID:
00573683
Message ID:
00573683
Views:
40
Function TOpen
Parameters cTable,nBuffering,cAlias
nPrevArea = Select()
If !Used(JustStem(JustFName(cTable)))
Use (cTable) in 0 Exclusive Order Alias (cAlias)
EndIf
Select (cAlias)
On Error *
TableRevert(.t.)
On Error
If VarType(nBuffering)="N"
CursorSetProp("Buffering",nBuffering)
Wait Window "Table " + cTable + "open in work area " + ;
Alltrim(Str(Select())) + Chr(13)+Chr(10)+ " BUFFERING " + ;
Alltrim(Str(nBuffering)) at 2,2
Select (nPrevArea)
Else
CursorSetProp("Buffering",1)
Wait Window "Table " + cTable + "open in work area " + ;
Alltrim(Str(Select())) + Chr(13)+Chr(10)+ " NO BUFFERING "  at 2,2
Select (nPrevArea)
EndIf
EndFunc


Function VOpen
Parameters cView,nBuffering,cAlias
nPrevArea = Select()
If !Used(cView)
Use (cView) in 0 NoData Shared Order Alias (cAlias)
EndIf
Select (cView)
On Error *
TableRevert(.t.)
On Error
If nBuffering = 3
CursorSetProp("Buffering",nBuffering)
Wait Window "View " + cView + "open in work area " + ;
Alltrim(Str(Select())) + Chr(13)+Chr(10)+ " ROW BUFFERING " + ;
Alltrim(Str(nBuffering)) at 2,2
Select (nPrevArea)
Else
CursorSetProp("Buffering",5)
Wait Window "View " + cView + "open in work area " + ;
Alltrim(Str(Select())) + Chr(13)+Chr(10)+" TABLE BUFFERING "  at 2,2
Select (nPrevArea)
EndIf
EndFunc
Suggestions wanted. This is for a single-user, all-local "exclusive use" app.

Thanks.
Next
Reply
Map
View

Click here to load this message in the networking platform