Name

Recordset.numfields — get the number of fields in a recordset

Synopsis

int Recordset.numfields ( );  

Description

Returns the number of columns in the recordset.

Example 72. Recordset.numfields Example

// Print the field names
for(int i = 0; i < rs.numfields(); i++)
{
    %>
    <p>Column #<%=i + 1%> is called '<%=htmlencode(rs.fieldname(i))%>'</p>
    <%
}

See Also

Data sources and database access in RSP is explained in the section called “Accessing Databases”