Views
Replies
Total Likes
var sDataConnectionName = "<value>"; // example - var sDataConnectionName = "MyDataConnection";
// Search for sourceSet node which matchs the DataConnection name
var nIndex = 0;
while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)
{
nIndex++;
}
var oDB = xfa.sourceSet.nodes.item(nIndex);
oDB.open();
oDB.first();
// Search node with the class name "command"
var nDBIndex = 0;
while(oDB.nodes.item(nDBIndex).className != "command")
{
nDBIndex++;
}
// Backup the original settings before assigning BOF and EOF to stay
var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("bofAction");
var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("eofAction");
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayBOF", "bofAction");
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayEOF", "eofAction");
var itemCount = 0;
while(!oDB.isEOF())
{
itemCount++;
oDB.next();
}
// Restore the original settings
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, "bofAction");
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, "eofAction");
// Close connection
oDB.close();
this.rawValue = itemCount;
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
<sourceSet xmlns="http://www.xfa.org/schema/xfa-source-set/1.0/">
<source name="DataConnection" db="ado">
<connect delayedOpen="0" timeout="15">[...]</connect>
<command timeout="30">
<query commandType="table">
<select>onecolumn</select>
<recordSet cursorType="static" cursorLocation="client" lockType="optimistic" bofAction="moveFirst" eofAction="moveLast"/>
<map from="title" bind="#bind0">
<?templateDesigner DataType 129?>
</map>
</query>
</command>
<bind id="bind0" ref="$record.DataConnection.title"/>
</source>
</sourceSet>
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
SELECT COUNT(*) as NumberOfRows FROM tablename WHERE selection_criteria_clause
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies
Views
Likes
Replies