Modificare il file:
\dblist\printrec.asp
<%@ language = "VBScript" %> <!--METADATA TYPE="TypeLib" NAME="Microsoft ActiveX Data Objects 2.6 Library" UUID="{00000206-0000-0010-8000-00AA006D2EA4}" VERSION="2.6" --> <% '---------------------------------------------------------------------------------------- '- ASP dbList - Version 8.1 - 30 July 2005 '- Copyright © 2005 - Livio Siri (http://www.livio.net) - All Rights Reserved. '---------------------------------------------------------------------------------------- option explicit response.buffer = true Dim conn, Rs, Total, sSQL, arrRS, sDSN, field, i Dim n_record, m_sTable, PrimaryKey, defaultsort Dim m_StandardFields() Dim m_StandardFieldsValue() Redim m_StandardFields(0) Redim m_StandardFieldsValue(0) m_sTable = Request.QueryString("strdbtable") n_record = Request.QueryString("member") sDSN = Request.querystring("dsn") PrimaryKey = Request.QueryString("primarykey") set conn = Server.CreateObject("ADODB.Connection") Set Rs = Server.CreateObject("ADODB.RecordSet") conn.open sDSN set rs.ActiveConnection = conn rs.CursorType = adOpenStatic sSQL = "SELECT * FROM " & m_sTable & " WHERE " & PrimaryKey & " LIKE ('%" & request.querystring("member") & "%')" '--- Open the RecordSet with a static cursor. This cursor provides bi-directional navigation Rs.Open sSQL, sDSN, adOpenStatic, adLockReadOnly, adCmdText i = 1 '--- loop through the fields in the recordset for each field in RS.Fields Redim Preserve m_StandardFields(UBound(m_StandardFields)+1) Redim Preserve m_StandardFieldsValue(UBound(m_StandardFieldsValue)+1) m_StandardFields(i) = field.name m_StandardFieldsValue(i) = field.value i = i + 1 next rs.close set rs = nothing conn.close set conn = nothing %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head> <title>Stampa Record</title> <STYLE type=text/css> BODY, P, TD { font-family: Tahoma, Verdana, Arial, sans-serif; font-size: 8pt; color: black; margin : 0; margin-left : 0; margin-right : 0; margin-top : 0; margin-bottom : 0; background-color : #FFFFFF; SCROLLBAR-BASE-COLOR: #CCCCCC; SCROLLBAR-FACE-COLOR: #8199DA; SCROLLBAR-HIGHLIGHT-COLOR: #B0C4DE; SCROLLBAR-SHADOW-COLOR: #333333; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #FFCC00; SCROLLBAR-TRACK-COLOR: #CCCCCC; SCROLLBAR-DARKSHADOW-COLOR: #8199DA; border:solid #CCCCCC 1; padding-left:5px; } TABLE {border:solid #CCCCCC 1;} A:hover { COLOR: #ff6600 } .prn_header, .prn_header_pk, .prn_header_btn, .prn_content_odd, .prn_content_odd_pk, .prn_content_even, .prn_content_even_pk { vertical-align: top; padding: 1.5pt; font-family:tahoma; } .prn_header { background-color: #E9E9E9; font-weight: bold; } .prn_header_pk { background-color: #DDDDDD; font-weight: bold; font-style: italic; } .prn_headline { font-family:Arial; font-size: 10pt; font-weight: bold; padding: 1pt; color: navy; } .prn_subheadline { font-size: 10pt; font-weight: bold; color: navy; } .prn_form_value { font-size: 10pt; } .prn_form_value_pk { font-size: 10pt; font-style: italic; } .notdborder {border:none;} </STYLE> </head> <BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#000000 ALINK=#000000 VLINK=#000000 TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0> <% buildHTML_Form Response.Write "</body></html>" ''-------------------------------------------------------------------------- Private Function buildHTML_Form() Dim sValue Response.Write "<TABLE cellSpacing=0 cellPadding=0 border=0 align=center class=""notdborder""><TBODY><TR>" & vbCrLf Response.Write "<TD height=26 class=""notdborder"">" & vbCrLf Response.Write "Tabella: " & vbCrLf Response.Write "<span class=""prn_headline"" STYLE=""FONT-SIZE:9Pt;"">" & m_sTable & "</span>" & vbCrLf %> <SCRIPT Language="Javascript"> /* This script is written by Eric (Webcrawl@usa.net) For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use, visit dynamicdrive.com */ function printit(){ if (window.print) { window.print() ; } else { var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; document.body.insertAdjacentHTML('beforeEnd', WebBrowser); WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; } } var NS = (navigator.appName == "Netscape"); var VERSION = parseInt(navigator.appVersion); if (VERSION > 3) { document.write('<a href="<%=Request.servervariables("SCRIPT_NAME")&"?"&Request.Querystring%>" title=" Print this page " onClick="printit()">Print</a>'); } </script> <% Response.Write " <a href="""" onClick=""self.close()"" title="" Close Window "">Chiudi la Finestra</a>" & vbCrLf Response.Write "</TD></TR></TBODY></TABLE>" & VbCrlf Response.Write "<table class=""prn_form"" border=0 cellpadding=0 cellspacing=2>" & vbCrLf '--- insert all fields for i = 1 to UBound(m_StandardFields) if m_StandardFields(i) = PrimaryKey Then Response.Write InsertField (m_StandardFields(i), m_StandardFieldsValue(i), True) Else Response.Write InsertField (m_StandardFields(i), m_StandardFieldsValue(i), False) End if next Response.Write "</table>" & vbCrLf End Function ''-------------------------------------------------------------------------- Private Function InsertField ( field, fieldvalue, bPrimaryKey ) Dim sReturn, sValue Dim sStyle, sStyleForm sStyle = "prn_header" sStyleForm = "prn_form_value" if bPrimaryKey then sStyle = sStyle & "_pk" sStyleForm = sStyleForm & "_pk" end if sReturn = sReturn & "<tr><td class=""" & sStyle & """ align=right valign=bottom>" & field & " </td><td class=""" & sStyleForm & """ width=""100%"">" if ISNULL(fieldvalue) then sValue = " " else sValue = fieldvalue sValue = Server.HTMLEncode(sValue) sValue = replace(sValue, CHR(13), "<br>") end if '--- display field value sReturn = sReturn & sValue & "</td></tr>" & vbCrLf InsertField = sReturn End Function %>
[
Íàçàä
]