Forum Discussion

Adagio's avatar
Adagio
Frequent Contributor
7 years ago
Solved

TestComplete and DB connection doesn't work on the Win-7 Virtual Machine

Hello,

 

I'm using the following connection string to connect TestComplete to AS400 database on my machine(WINDOWS 10). The connection works just fine. I'm not creating/using any DSN on my machine. I'm rather using the available driver - ' iSeries Access ODBC Driver'.

 

 

 

 

  var  conn  = ADO.CreateADOConnection();
  conn.ConnectionString =
                "Driver= {iSeries Access ODBC Driver};" +
                "Data Source = "+Project.Variables.Database+";" +
                "CurrentSchema=SHPR;" +
                "User ID= "+Project.Variables.ID+";" +
                "Password="+Project.Variables.Password.DecryptedValue+";" 

 

 

Also, I'm trying to run all my tests on a virtual machine too which is 64-bit, Windows 7 machine. This machine also has the required driver available. In the beginning I was able to run the all the Tests on the virtual Machine when I was using a DSN(I created multiple DSNs), but later on I wanted to stop using the DSNs because I didn't want to create multiple DSNs on multiple machines and rather use the available drivers.

 

 

I tried using the same connection as mentioned above, but it fails to connect to the database with the following error:

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

 

I'm trying to understand what's the reason behind it because the same connection works just fine on my local machine.

Any help would be appreciated.

 

Thank you

Abhi

 

 

 

  • Adagio's avatar
    Adagio
    7 years ago

    Thank you for your reply, Robert! ODBC was already configured, but now it seems I was making some mistake in the connection string itself.

     

    I had to replace 'Data Source' by 'System' , and it worked fine on the Virtual Machine. I believe the system thinks of DSN when it sees ' Data Source' in the connection string.

     

    Thank you

    Abhi

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    And ODBC connection is a connection that is configured within the Windows OS which you then access within TestComplete.  So, most likely, you set up the ODBC on your Windows 10 machine but it's not configured on your Windows 7.  In both environments, this is done under the Windows Administrative Tools... there is an option for Data Sources (ODBC).  Configure your data source there, replicating what you have in your Windows 10 machine, and it should be able to run.

    • Adagio's avatar
      Adagio
      Frequent Contributor

      Thank you for your reply, Robert! ODBC was already configured, but now it seems I was making some mistake in the connection string itself.

       

      I had to replace 'Data Source' by 'System' , and it worked fine on the Virtual Machine. I believe the system thinks of DSN when it sees ' Data Source' in the connection string.

       

      Thank you

      Abhi