fnShowRecord() fnShowRecord(...) DESCRIPTION See fnDisplayRecord instead This function returns an HTML string to display one record from a database table on a webpage. The record is formatted as an HTML table. The labels for the fields of the data can be specified as can the colours used in the display. SYNTAX <%= fnShowRecord(strOpen, ooConnection, [aaConnect], [aaLabels], [aaColourInfo]) %> EXAMPLE <%@ Language=VBScript %> <% Response.Buffer = true %> This page tests the function fnShowRecord <% '-->-->-->-->-->-->-->-->--> dim adoCon dim sQuery set adoCon = Server.CreateObject("ADODB.connection") adoCon.Open "DRIVER={SQL Server};SERVER=(local)", "sa", "" adoCon.DefaultDatabase = "pubs" sQuery = "SELECT * " & _ "FROM publishers " & _ "WHERE pub_id = 0736 " Response.Write fnShowRecord(sQuery, adoCon) set adoCon = nothing '--<--<--<--<--<--<--<--<--< %> RESULTS (approximate) Record The output is a formatted table containing the data from the record selected from the table PARAMETERS strOpen- This is the string which is used to open the recordset If the recordset contains more than one record, then only the first record will be displayed. Alternatively this string can be the name of a table or the name of a stored procedure followed by any PARAMETERS. ooConnection- This is the ADO connection to the database which is used as the active connection for the recordset. [aaConnect]- This is an array containing the information which is to be used to open the database. This parameter is only used if an open connection is not passed (ooConnection parameter). . aaConnect[0] The database driver type (default: 'sql server') aaConnect[1] The IP of the server (default: '(local)') aaConnect[2] The user name (default: 'sa') aaConnect[3] The password for that user (default: 'max') aaConnect[4] The database name. [aaLabels]- This is an array containing the labels to be used for each of the fields for the table record, including the title which will be used for the record display. These labels default to the field-names for the table. aaLabels[0] the title for the data record aaLabels[n] the labels for the fields of the data. [aaColourInfo]- This provides the information for what colours to use in the record display: aaColourInfo[0] the background colour for the html table aaColourInfo[1] the background colour for the labels cells aaColourInfo[2] the background colour for the values cells. aaColourInfo[3] the font colour for the labels. aaColourInfo[4] the font colour for the values. STATUS Working, tested 20% PROGRAMMER Matthew Bishop (matthew@massive.com.au or matth3wbishop@yahoo.com) LOCATION c:http://www.geocities.com/matth3wbishop/eg/asp/ DOCUMENTATION: http://www.geocities.com/matth3wbishop/eg/asp/ COMMENTS: If more than 1 record is returned by the query then only the first record is displayed The function has error handling. The function calls fnErrorMessage and therefore 'fnErrorMessage.asp' must be included. If an array for the field label is passed to the function not all the array values must be specified. i.e There are complete default handling routines. If a parameter is omitted but a later