getdatasources — enumerate available data sources
string[] getdatasources ( |
) ; |
Example 34. getdatasources Example
This example code populates a select control with the names of all the defined data sources.
<select name="datasource"> <% string[] sources = getdatasources(); for(int i = 0; i < sources.length(); i++) print("<option value=\"" + htmlencode(sources[i]) + "\">" + htmlencode(sources[i]) + "</option>\n"); %> </select>
Data sources and database access in RSP is explained in the section called “Accessing Databases”