% Response.Expires = 0 Response.ExpiresAbsolute = Now() - 1 Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate" %> <% If Not IsLoggedIn And Request.Cookies(ewProjectName)("autologin") = "autologin" And Request.Cookies(ewProjectName)("password") <> "" Then Response.Redirect "login.asp" Call LoadUserLevel() If IsLoggedIn Then ewCurSec = CurrentUserLevelPriv("Cuentas") Else ewCurSec = GetAnonymousPriv("Cuentas") End If If (ewCurSec And ewAllowView) <> ewAllowView Then Response.Redirect "Cuentaslist.asp" %> <% ' Initialize common variables x_ID = Null: ox_ID = Null: z_ID = Null x_Vendedora = Null: ox_Vendedora = Null: z_Vendedora = Null x_Empresa = Null: ox_Empresa = Null: z_Empresa = Null x_RazonSocial = Null: ox_RazonSocial = Null: z_RazonSocial = Null %> <% Response.Buffer = True x_ID = Request.QueryString("ID") If x_ID = "" Or IsNull(x_ID) Then Response.Redirect "Cuentaslist.asp" ' Get action sAction = Request.Form("a_view") If sAction = "" Or IsNull(sAction) Then sAction = "I" ' Display with input box End If ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str Select Case sAction Case "I": ' Get a record to display If Not LoadData() Then ' Load Record based on key Session(ewSessionMessage) = "No records found" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "Cuentaslist.asp" End If End Select %>
View TABLE: Cuentas
Back to List
<% If (ewCurSec And ewAllowEdit) = ewAllowEdit Then %>
">Edit
<% End If %>
<% If (ewCurSec And ewAllowAdd) = ewAllowAdd Then %>
">Copy
<% End If %>
<% If (ewCurSec And ewAllowDelete) = ewAllowDelete Then %>
">Delete
<% End If %>
<% conn.Close ' Close Connection Set conn = Nothing %> <% '------------------------------------------------------------------------------- ' Function LoadData ' - Load Data based on Key Value ' - Variables setup: field variables Function LoadData() Dim rs, sSql, sFilter sFilter = ewSqlKeyWhere If Not IsNumeric(x_ID) Then LoadData = False Exit Function End If sFilter = Replace(sFilter, "@ID", AdjustSql(x_ID)) ' Replace key value sSql = ewBuildSql(ewSqlSelect, ewSqlWhere, ewSqlGroupBy, ewSqlHaving, ewSqlOrderBy, sFilter, "") Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSql, conn If rs.Eof Then LoadData = False Else LoadData = True rs.MoveFirst ' Get the field contents x_ID = rs("ID") x_Vendedora = rs("Vendedora") x_Empresa = rs("Empresa") x_RazonSocial = rs("RazonSocial") End If rs.Close Set rs = Nothing End Function %>