Forum Discussion

tristaanogre's avatar
tristaanogre
Esteemed Contributor
8 years ago

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!

  • I still think it's funny that the term is Bitness :smileyvery-happy:

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    process = Sys.WaitProcess('Test*te');

    is a one-liner for

            if (Sys.WaitProcess('TestExecute').Exists) {
                process = Sys.Process('TestExecute')
            }
            else {
                process = Sys.Process('TestComplete');
            }

    :smileyembarrassed:

     

    Just my $0.02... :)

     

  • NisHera's avatar
    NisHera
    Valued Contributor

    Hi,

    I recently updated TC12.6 to 14.

    Found that I have to transfer some setup (my own envirenment) to run TC14.

    so desided to run 12.6 untill 14 envirenment is ready.

    But erorr keep comming...

    The needed data source driver is not installed or is not configured properly.
    To read data, install the 32-bit version of Microsoft Office 12.0 Access Database Engine OLE DB Provider. It is part of Microsoft Access Database Engine 2010 Redistributable. You can find it on the Microsoft website

     

    tried this and that and at the end...

    uninstall Access database install 32-bit and even as last resort uninsatall TC14

    It start working.

     

    My project suite has sevaral projects in one project at the end of run stop working saying...

     

    The needed data source driver is not installed or is not configured properly.
    To read data, install the 64-bit version of Microsoft Office 12.0 Access Database Engine OLE DB Provider. It is part of Microsoft Access Database Engine 2010 Redistributable. You can find it on the Microsoft website. Alternatively, you can try using the 32-bit version of TestComplete

     

    whent inside code and compare....

    other than variables nothing deference both are true for ACE drive

     

    DDT.ExcelDriver(Project.Variables.DataXL,'Pre_Data',true);
    
    DDT.ExcelDriver(dtaFile,"Batch_update",true); 

    What is the problem? both places were working fine early before TC14 installation.

    • NisHera's avatar
      NisHera
      Valued Contributor

      ...never mind found the error.

      I 'm running projects separately from command prompt.

      one is directed to TC12.6 exe in Bin folder(version x86) other x64/Bin exe.