| Exported Session Variables |
All session variables are suffixed with the dbUnit. By default, the dbUnit is null. In this case, accessing any of the Session variables would be done as follows, Set MyRS = Session("SV_variablename"). In the case of having multiple databases on a single web page, the databases are differentiated with the dbUnit. On our web site, we have an example of a web page with two database tables on it. We used "1" and "2" for our two dbUnits. For example, if DbUnit=1, then the exported variable would be exported as Session("SV_variablename_1"). To access the variable, you would use code such as: Myvar = Session("SV_variablename_1").
| Session Variable Name | Description |
| SX | dbUnit |
| SV_FieldCount | Actual Recordset Field count. |
| SV_SelectBoxItem | The chosen item from the SelectBox line. |
| SV_Filter | Filter String. This variable is set to the filter criteria string whether the filter is in action / failed or not. The reason is that when a filter fails, user should know what what filter condition caused and EOF. In order to check whether filter is working check the session("FilterSQL_Unit") variable. If this variable is blank then filter is not set. |
| SV_GridStart | Record index number of the top grid row. |
| SV_GridInc | The number of rows to display |
| SV_ColorIndex | Current color index (1-15) |
| SV_FormPtr | Record index number of form record. This number is either the same as the GridStart or a selected record in "dual" mode. |
| SV_RecAffected | Check this session variable after an edit to see how many (if any) records were modified.-1 = Not currently set (no problem)0 = No records affected (problem)>1 = Number of records affected (success).Example:If Session("SV_RecAffected_1") = 0 Then Response.write("Error: No records affected.")If Session("SV_RecAffected_1") = 1 Then Response.write("One record was added or modified.") |
| SV_RecordPointer | This is the value to "move" to. |
| InFilterMode | This value is True when the filter screen is being displayed. |
| ASPdb_Layout_Unit_ID | This session variable exports the MagicLayout objects. Magic layout can be a chart, block, selectbox etc. See dbMagicLayout for more details. |
| FormNavBar, GridNavBar | see dbSendTemplate for exported template session variables |
Example Code: -
<%
Set X=Server.CreateObject("ASP.db")
X.dbUnit = 1
X.property = value … (your code) …
X.ASPdb
rc = X.dbRecordCount
response.write("RecordCount = " & rc & "<BR>")
response.write("SV_FieldCount = " & session("SV_FieldCount_1") & "<BR>")
response.write("SV_SQL = " & session("SV_SQL_1") & "<BR>")
response.write("SV_Filter = " & session("SV_Filter_1") & "<BR>")
response.write("SV_GridStart = " & session("SV_GridStart_1") & "<BR>")
response.write("SV_GridInc = " & session("SV_GridInc_1") & "<BR>")
response.write("SV_FormPtr = " & session("SV_FormPtr_1") & "<BR>")
response.write("SV_ColorIndex = " & session("SV_ColorIndex_1") & "<BR>")
..
Set Y=Server.CreateObject("ASP.db")
Y.dbUnit = 2
Y.property = value … (your code) …
Y.ASPdb
rc = Y.dbRecordCount
response.write("RecordCount = " & rc & "<BR>")
response.write("SV_FieldCount = " & session("SV_FieldCount_2") & "<BR>")
response.write("SV_SQL = " & session("SV_SQL_2") & "<BR>")
response.write("SV_Filter = " & session("SV_Filter_2") & "<BR>")
response.write("SV_GridStart = " & session("SV_GridStart_2") & "<BR>")
response.write("SV_GridInc = " & session("SV_GridInc_2") & "<BR>")
response.write("SV_FormPtr = " & session("SV_FormPtr_2") & "<BR>")
response.write("SV_ColorIndex = " & session("SV_ColorIndex_2") & "<BR>")
%>