<%@ LCID = 3081 %> <% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.addHeader "cache-control", "no-cache" Response.addHeader "cache-control", "no-store" Response.CacheControl = "no-cache" %> <% ewCurSec = 0 ' Initialise ' User levels Const ewAllowAdd = 1 Const ewAllowDelete = 2 Const ewAllowEdit = 4 Const ewAllowView = 8 Const ewAllowList = 8 Const ewAllowReport = 8 Const ewAllowSearch = 8 Const ewAllowAdmin = 16 %> <% ' Initialize common variables x_SITE_HEADING = Null: ox_SITE_HEADING = Null x_SITE_URL = Null: ox_SITE_URL = Null x_COMMENTS = Null: ox_COMMENTS = Null x_DFRECNUM = Null: ox_DFRECNUM = Null %> <% Response.Buffer = True x_DFRECNUM = Request.QueryString("DFRECNUM") If x_DFRECNUM = "" Or IsNull(x_DFRECNUM) Then Response.Redirect "SITELINKlist.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("ewmsg") = "No records found" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "SITELINKlist.asp" End If End Select %>

View TABLE: SITELINK

Back to List  ">Edit  ">Copy  ">Delete 

SITE HEADING <% Response.Write x_SITE_HEADING %>
SITE URL <% Response.Write x_SITE_URL %>
COMMENTS <% Response.Write x_COMMENTS %>
DFRECNUM <% Response.Write x_DFRECNUM %>

<% conn.Close ' Close Connection Set conn = Nothing %> <% '------------------------------------------------------------------------------- ' Function LoadData ' - Load Data based on Key Value ' - Variables setup: field variables Function LoadData() Dim sSql, rs, sWhere, sGroupBy, sHaving, sOrderBy sSql = "SELECT * FROM [SITELINK]" sWhere = "" sGroupBy = "" sHaving = "" sOrderBy = "" If sWhere <> "" Then sWhere = sWhere & " AND " sWhere = sWhere & "([DFRECNUM] = " & AdjustSql(x_DFRECNUM) & ")" sSql = sSql & " WHERE " & sWhere If sGroupBy <> "" Then sSql = sSql & " GROUP BY " & sGroupBy End If If sHaving <> "" Then sSql = sSql & " HAVING " & sHaving End If If sOrderBy <> "" Then sSql = sSql & " ORDER BY " & sOrderBy End If 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_SITE_HEADING = rs("SITE_HEADING") x_SITE_URL = rs("SITE_URL") x_COMMENTS = rs("COMMENTS") x_DFRECNUM = rs("DFRECNUM") End If rs.Close Set rs = Nothing End Function %>