Forum Discussion

simonaferrara's avatar
simonaferrara
Frequent Contributor
2 years ago
Solved

Database connection - Provider not found

Hi,

 

I'm trying to access to a SQLLite database, by following the instructions and the examples explained within the page:

https://support.smartbear.com/testcomplete/docs/testing-with/working-with-external-data-sources/databases/ado-components.html

so, for example, I'm using the following code to open the connection:

 

var Conn = getActiveXObject("ADODB.Connection");
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=C:\\Users\\Public\\Documents\\TestComplete 15 Samples\\Desktop\\Checkpoints\\XML\\DataGridViewSample\\OrdersDB.mdb";
Conn.Open();

 

But the Open connection function returns the following error: "Provider cannot be found. It may not be properly installed" .

 

I've tried to resolve by installing the "Microsoft Office Access database engine 2007", "Microsoft Office Access database engine 2010" (both x64 and x32 bit), but there is still the same error.

 

Can you please help me to understand what I've to install to make the provider found?

 

Thanks

Simona

 

 

 

 

 

  • Here's a 32-bit version of TestComplete (x86) shown in Task Manager

    This is the 64-bit version of TestComplete (x64),

     

    Microsoft.Jet.OLEDB.4.0 only supports 32-bit. 

     

    To work with 64-bit databases, you need to download the correct ODBC Driver for SQLite, and then use the correct connection string for SQLite. For example,

     

     

     

     

8 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Here's a 32-bit version of TestComplete (x86) shown in Task Manager

    This is the 64-bit version of TestComplete (x64),

     

    Microsoft.Jet.OLEDB.4.0 only supports 32-bit. 

     

    To work with 64-bit databases, you need to download the correct ODBC Driver for SQLite, and then use the correct connection string for SQLite. For example,

     

     

     

     

  • simonaferrara's avatar
    simonaferrara
    Frequent Contributor

    Thanks rraghvani for the previous instructions, I've been able to open the connection with the database! Now I'm working to correctly read the needed data from it.
    And also thanks to AlexKaras for the useful information that help me to better understand the issues!

     

    Regards,

    Simona

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    In the following folder where TestComplete is installed, for example

    There's a Bin folder that has the 32-bit version of TestComplete. The x64 folder, has the 64-bit version of TestComplete.

     

    You can launch it via C:\Program Files (x86)\SmartBear\TestComplete 15\Bin\TestComplete.exe

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Simona,

     

    Usually the 'provider not found' error occurs when bitness of the installed provider does not match bitness of TestComplete. Can you confirm that you are using TestComplete of the same bitness as the installed provider?

     

    Also, is your test project JavaScript-based? getActiveXObject() works for JavaScript and Sys.OleObject() should be used for test projects based on other languages.

     

  • simonaferrara's avatar
    simonaferrara
    Frequent Contributor

    Hi,

     

    AlexKaras I've checked the Test Complete version that I'm using, and it is the following one: 

    Version: 15.40.421.7 x64

    So, it's a 64 bit version and, as rraghvani share, I've now understand that it is not compliant with OLEDB provider (that runs only with 32 bit).

     

    I'm using JavaScript language.

     

    Can you please let me understand if I've to use a provider different from the OLEDB one? If so, which should be the provider and which prerequisites I've to install, if needed?

     

    Thanks!

    Simona

     

  • simonaferrara's avatar
    simonaferrara
    Frequent Contributor

    Do you mean that I've to mandatory use the 32-bit version?

    Is not existing a way to interact within a database using the 64-bit Test Complete? In this case, it is an issue for us because we have 64-bit systems.

     

    Anyway, even if change the exe to launch within every machine is not is a way that I like, but I've tried to launch it from the suggested Bin and TestComplete is opened with x86 version (not x32). In this case there is no provider error, but I fall in a new error, where the .db format (the format of my database) is not recognized.

     

     

    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      Hi Simona,

       

      we have 64-bit systems

      32-bit TestComplete runs perfectly fine on 64-bit systems. So I would not consider the necessity to use 32-bit TestComplete as a showstopper.

       

      TestComplete is opened with x86 version

      x86 means 32-bit version.

       

      Is not existing a way to interact within a database using the 64-bit Test Complete?

      General architecture is like this:

      -- TestComplete talks to ADO layer (you may use either pure ADO objects or ADODB wrapper provided by TestComplete as is done in your code sample). It is required for TestComplete and ADO to have same bitness (actually, as ADO is provided by the OS, it guarantees that both 32-bit and 64-bit ADO objects are installed);

      -- ADO uses provided connection string and talks either to corresponding data provider or to ODBC. ADO data provider is a component that might be either installed by the system (like SQL Server data provider) or by the end-user (for specific data sources, like SQLLite in your case). It is required for data provider to be of the same bitness as ADO (and TestComplete) because ADO can communicate with data providers/ODBC drivers of the bitness that matches bitness of ADO layer;

      -- Data provider or ODBC driver talks to data source and provides or manipulates with data source data. Usually, data providers of some bitness can communicate with data sources of different bitness.

       

      Considering the above, you must look for either ADO data provider or ODBC driver that:

      a) Provides you with required functionality; and

      b) Has bitness that is convenient for you.

       

      If data provider or ODBC driver exists only of certain bitness then you have no other way but use TestComplete of the bitness that matches the bitness of data provider/ODBC driver.