You are here: Reference > JavaScript > client-side > ActiveX > ADO > methods > namedRecordset (applet, object, xml)
namedRecordset method (applet, object, xml)
Returns a recordset object that represents the records of the specified data member from a data source object.
Syntax:
You can find the related objects in the Supported by objects section below.
Parameters:
Required. String that specifies the name of the data member. Use an empty string to get the default data member (such as the recordset property). | |||||||
Optional. String that specifies a hierarchical path to a sub-dataset. |
Return value:
Returns a recordset object or null.
Example HTML code 1:
This example illustrates the use of the namedRecordset method:
|
|||||
<head> <script type="text/javascript"> function OnNewsComplete () { var boundingObj = event.srcElement; var items = boundingObj.namedRecordset ("", "item"); items.MoveFirst (); while (!items.EOF) { var title = items.Fields ("title").value; var link = items.Fields ("link").value; DisplayItem (title, link); items.MoveNext (); } } function DisplayItem (title, link) { var htmlcode = '<i><a href="'+link+'" target="_blank">'+title+'</a><br /></i>'; document.getElementById ('news').innerHTML += htmlcode; } </script> </head> <body> <xml src="news.xml" onDatasetComplete="OnNewsComplete ();"></xml> <div id="news"></div> </body> |
|||||
|
|||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments