Kirix Support Forums

recordset loop reset

Please post any help questions, requests or other feedback here.

recordset loop reset

Postby abenitez77 on Mon Feb 28, 2011 11:47 am

How do i go back to the beginning of a recordset after looping thru the entire recordset? I have a form with a loop(below) and when I want to hit the button again which runs this loop below, I need it to start from the top of the recordset. I guess I would need the command before the while statement, I only need the syntax. thanks.

while (SQLTbl.next())
{
icount = icount + 1;
//Loop thru the field names in the sql table.
for (var e = 0; e < info.length; ++e)
{
fname = info[e].name;
inserter[SQLTbl.getColumnName(e)] = SQLTbl[fname];
}
//insert the row
inserter.insertRow();
// Fill the progressbar
if (icount >= drows)
{
iten = iten + 10;
m_progressbar.setValue(iten);
drows = drows + irows;
}
}
abenitez77
Registered User
 
Posts: 143
Joined: Fri Jan 21, 2011 12:42 pm

Re: recordset loop reset

Postby Aaron on Mon Feb 28, 2011 1:05 pm

At this time, result sets are "forward only". To go to the beginning of the record set, you have to rerun the query or cache the results.
Aaron Williams
Kirix Support Team
User avatar
Aaron
Kirix Support Team
 
Posts: 120
Joined: Fri Dec 16, 2005 3:01 pm

Return to Strata Help & Feedback