[script language = jscript runat = server] /*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--* * FUNCTION: fnDbugRecordset() * DESCRIPTION: This function displays the contents of a ADO recordset on a blank web page and terminates any further output from the server. This function is designed to be used for debugging queries against databases. * STATUS: working * DOCUMENTED AT: http://www.geocities.com/matth3wbishop/eg/asp/ * CODE LOCATION: http://www.geocities.com/matth3wbishop/eg/asp/ *--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*/ function fnDbugRecordset(adoRs) { var sOutput = new String(""); var iRowCounter; //adoRs.GetRows(); //debug( if (adoRs == null) { fnErrorMessage( "fnDbugRecordset", "adoRs", "A required parameter was omitted<br>"); } /* if adoRS is null */ if (typeof(adoRs) != "object") { fnErrorMessage( "fnDbugRecordset", "adoRs", "The parameter must be an ADO recordset object<br>"); } /* if adoRS not an object */ sOutput += "<table align = 'center' border = '0'\n" + " cellpadding = '1' cellspacing = '0'>"; sOutput += "<tr>\n"; sOutput += " <td><i>Row Number</i></td>\n"; for (var ii = 0; ii < adoRs.Fields.Count; ii++) { sOutput += " <td><b>" + Server.HTMLEncode(adoRs.Fields.Item(ii).Name) + "</b></td>\n"; } /* for */ sOutput += "</tr>\n"; iRowCounter = 1; while (!adoRs.EOF) { sOutput += "<tr>\n"; sOutput += " <td>" + iRowCounter + "</td>\n"; for (var ii = 0; ii < adoRs.Fields.Count; ii++) { sOutput += " <td>" + Server.HTMLEncode(adoRs.Fields.Item(ii).Value) + "\n" + " </td>\n"; } /* for */ sOutput += "</tr>\n"; adoRs.Movenext(); iRowCounter++; } /* while not eof */ sOutput += "</table>"; Response.Clear(); Response.Write(sOutput); Response.End(); } /* fnDbugRecordset */ [</script]