Pro-Tip: DDT and Bitness
As some of you are aware, Microsoft did a "wonderful" thing to anyone using the JET database driver in a recent update. The result is that, if you're using the DDT.ExcelDriver object in TestComplete, you may come up with errors and such about needing to install a provider (see https://smartbear-cc.force.com/portal/KbArticleViewer?name=Unexpected-Driver-Error-2017&sp=TestComplete).
Additionally, TestComplete/TestExecute version 12.4x actually has a 64-bit version that can be used. So, there is now a difficulty in determining, when using DDT.ExcelDriver, whether or not to use the ACE option. I recently ran into this difficulty. I have the proper driver installed as per the KB article, but if I'm using the ACE option but opt to run my tests in 32-bit, things don't always work so well.
So... I needed to add some code to determine a) what bitness I'm running TestComplete/TestExecute in and b) depending upon that which Excel driver to use. This is what I came up with:
//First, check to see if I'm running within TestExecute or TestComplete if (Sys.WaitProcess('TestExecute').Exists) { process = Sys.Process('TestExecute') } else { process = Sys.Process('TestComplete'); } //Once I determine which tool I'm using, I check the ProcessType property of the process //If it's 64 bit, use the ACE driver if (process.ProcessType === 'x64') { myData = DDT.ExcelDriver(Project.ConfigPath + '\\Script\\mySpreadSheet.xls', 'Data', true); } //If it's 32 bit, don't else { myData = DDT.ExcelDriver(Project.ConfigPath + ''\\Script\\mySpreadSheet.xls', 'Data', false); }
I can now run the same set of tests using either the 32-bit or the 64-bit version of TestComplete/TestExecute without trouble.
Hope this helps someone else!