<script language = jscript runat = server> 
/*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--* 
* FUNCTION: fnRecordsetToColumn() 
* DESCRIPTION: This function converts the values in a particular 
  field of a recordset to a delimited string. 
* STATUS:? in dev  
* DEPENDENCIES: 
    fnErrorMessage [?] 
* DOCUMENTED AT: c:\mjbLibrary\aspScripts\Documentation\ 
* CODE LOCATION: c:\mjbLibrary\aspScripts\sourceCode\ 
*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*/ 
  function fnRecordsetColumnToString(adoRs) 
  { 
    //dbug(typeof(adoRs)); 
    var sOutput = new String(""); 
    var iRowCounter; 
     
    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();         
  } /* fnRecordsetColumnTo */                            
 
</script>