Forum Discussion
Kostja
11 years agoContributor
Okay, i solved the counting problem for one script.
Is there a way to extend the following code to several others without specifying one by one?
function Iterate()
{
//var ifzero = 1;
var RecSet, Cmd;
// Create a new object
Cmd = ADO.CreateADOCommand();
// Specify the connection string
Cmd.ConnectionString = "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=test;Uid=uid;Pwd=pwd;";
// Specify the command text (the SQL expression)
Cmd.CommandText = "SELECT COUNT(`Description`) FROM `testlogs1` WHERE `Description` = \"Started the Script Select_BFR\"";
// Specify the command type
Cmd.CommandType = cmdText;
// Execute the command
RecSet = Cmd.Execute();
// Process the table records
if (RecSet.Fields("COUNT(`Description`)").Value < 1)
{
return 1;
}
else
{
return RecSet.Fields("COUNT(`Description`)").Value +1;
}
}