Difference between revisions of "SAVE DATASESSION"

From Lianjapedia
Jump to: navigation, search
 
(4 intermediate revisions by 2 users not shown)
Line 6: Line 6:
  
 
==See Also==
 
==See Also==
[[REPLACE()]], [[RESTORE RECORDVIEW]], [[RESTORE DATASESSION]], [[SAVE RECORDVIEW]], [[SKIP]]
+
[[DATASESSIONLEVEL()]], [[POP DATASESSION]], [[PUSH DATASESSION]], [[REPLACE()]], [[RESTORE RECORDVIEW]], [[RESTORE DATASESSION]], [[SAVE RECORDVIEW]], [[SKIP]]
  
 
==Description==
 
==Description==
Line 24: Line 24:
  
 
The [[RESTORE DATASESSION]] command may be used to restore the above information. SAVE and RESTORE DATASESSION can be used with Lianja Web session variables ( _SESSION[ ] ) to maintain context between different .rsp web page requests.
 
The [[RESTORE DATASESSION]] command may be used to restore the above information. SAVE and RESTORE DATASESSION can be used with Lianja Web session variables ( _SESSION[ ] ) to maintain context between different .rsp web page requests.
 +
 +
Note: when SAVE DATASESSION is issued, if a database is open it remains open, but all tables are closed.
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
 
save datasession
 
save datasession
close all
 
  
 
// open up some new tables in a new datasession
 
// open up some new tables in a new datasession
Line 47: Line 48:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
[[Category:Data Commands]]
+
[[Category:Databases]]
 
[[Category:Lianja VFP Extensions]]
 
[[Category:Lianja VFP Extensions]]
 
[[Category:VFP Command Extensions]]
 
[[Category:VFP Command Extensions]]

Latest revision as of 06:03, 19 March 2018

Purpose

Save the status of the current data session

Syntax

SAVE DATASESSION [ TO <memvar>]

See Also

DATASESSIONLEVEL(), POP DATASESSION, PUSH DATASESSION, REPLACE(), RESTORE RECORDVIEW, RESTORE DATASESSION, SAVE RECORDVIEW, SKIP

Description

The SAVE DATASESSION command is used to save the status of all open database tables. The SAVE DATASESSION command saves the following information pertaining to the current session for each open table:

  • Currently selected cursor/workarea
  • Cursor/Workarea number
  • Database name
  • Full path of table
  • All index files
  • Current record number
  • Current index order
  • Lock status
  • eof() status
  • bof() status
  • found() status

The RESTORE DATASESSION command may be used to restore the above information. SAVE and RESTORE DATASESSION can be used with Lianja Web session variables ( _SESSION[ ] ) to maintain context between different .rsp web page requests.

Note: when SAVE DATASESSION is issued, if a database is open it remains open, but all tables are closed.

Example

save datasession
 
// open up some new tables in a new datasession
 
restore datasession
save datasession to statevar
_session[ "statevar" ] = statevar
 
// you can then restore the session on the next web page request like this
 
statevar = _session[ "statevar" ]
restore datasession from statevar