Forum Discussion
tristaanogre
13 years agoEsteemed Contributor
I wouldn't use for loops. I'd use nested while loops using DDT.ExcelDrivers.
It would look something like this. Please note, this is pseudocode. Accuracy and runability is not guarenteed. Supplied only to give an idea of the methodology.
It would look something like this. Please note, this is pseudocode. Accuracy and runability is not guarenteed. Supplied only to give an idea of the methodology.
function DoThisThing();
{
var CompanyDDT = DDT.ExcelDriver("C:\\MyPath\\MyWorkbook.XLS", "CompanySheet", true)
var EmployeeDDT
while (!CompanyDDT.EOF)
{
EnterCompanyData();
EmployeeDDT = DDT.ExcelDriver("C:\\MyPath\\MyWorkbook.XLS", "EmployeeSheet", true)
EmployeeDDT..ADOCommandObject.CommandText = "SELECT * from [EmployeeSheet$] where [CompanyID] = '" + CompanyDDT.Value("CompanyID" + "'";
while (!EmployeeDDT.EOF)
{
EnterEmployeeData();
EmployeeDDT.Next();
}
DDT.CloseDriver(EmployeeDDT.Name);
CompanyDDT.Next();
}
DDT.CloseDriver(CompanyDDT.Name);
}
Related Content
Recent Discussions
- 2 days agoMW_Didata