Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Safe Table Opening Code -How's This?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Safe Table Opening Code -How's This?
Divers
Thread ID:
00573683
Message ID:
00573683
Vues:
39
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform