Forum Discussion
Ryan_Moran
10 years agoValued Contributor
As a solution to this in my own data driven scripts I have implimented an index to all my sheets named "Row".
eselect is a function that executes sql select statements and returns the recordset.
ecommand is a function that executes sql commands.
The indexing runs when I start my test and takes approx. 5-10 seconds at most.
Additionally you'll notice that I pull the "rowcount" with a select statement when the indexing starts. Enjoy.
JScript example:
function indexsheet(){
var rs = eselect("SELECT Count(*) From [Script$]");
while (!rs.EOF){
c = rs(0).Value;
rs.MoveNext;
}
rs.close();
rs = null;
ecommand("Update [Script$] Set [Row] = ''");
for (var x = c + 1;x > 1;x--){
ecommand("Insert Into [Script$A" + (x - 1) + ":A" + (x - 1) + "] VALUES (" + x + ")");
}
}
eselect is a function that executes sql select statements and returns the recordset.
ecommand is a function that executes sql commands.
The indexing runs when I start my test and takes approx. 5-10 seconds at most.
Additionally you'll notice that I pull the "rowcount" with a select statement when the indexing starts. Enjoy.
JScript example:
function indexsheet(){
var rs = eselect("SELECT Count(*) From [Script$]");
while (!rs.EOF){
c = rs(0).Value;
rs.MoveNext;
}
rs.close();
rs = null;
ecommand("Update [Script$] Set [Row] = ''");
for (var x = c + 1;x > 1;x--){
ecommand("Insert Into [Script$A" + (x - 1) + ":A" + (x - 1) + "] VALUES (" + x + ")");
}
}
Related Content
Recent Discussions
- 16 hours agojstaehlin
- 2 days agoAivanitskiy