Forum Discussion

duvenhage's avatar
duvenhage
Occasional Contributor
7 years ago

MySQL DB Connection: Initial catalog does not change

I'm trying to do DDT using a db table but TC is using the wrong db (initial catalog).

 

My initial connection string (used for a db checkpoint) was 

Provider=MSDASQL.1;Persist Security Info=False;User ID=username;Data Source=MySQL_ANSI;Initial Catalog=wsgtestsim_dev

and that works fine.

 

My connection string for the DDT is

Provider=MSDASQL.1;Persist Security Info=False;User ID=username;Data Source=MySQL_ANSI;Initial Catalog=test

but, despite specifying a different initial catalog, I only see the tables in the original initial catalog (wsgtestsim_dev) and nothing from the new initial catalog (test).

 

Any idea why this happens?

  • duvenhage's avatar
    duvenhage
    7 years ago

    This seems to be an inconsistency between TC and the db driver, i.e. not a mistake per se.

     

    When I installed and configured the driver (in Windows), I specified a db and, irrespective of what the initial catalog parameter contains, the db specified during configuration is what is used. In fact, it seems that the initial catalog parameter is completely ignored - I created a configuration in Windows without a db and it validates just fine, but cannot be used in TC because TC apparently expects it to already be bound to a db. Specifying a db in the connection string makes no difference.

     

    The solution (such as it is...) is to create a config for every db needed.

  • Try using your second connection string first just to make sure it's valid. 

     

    The other thing I would do is forcibly close the first connection right after the checkpoint.  Always best to clean those things up when you're done.

    • duvenhage's avatar
      duvenhage
      Occasional Contributor

      Thanks for the answer.

       

      I restarted TC and built the second connection string via the wizard. It still shows me the tables from the first connection string's DB.

       

      How does one forcibly close a connection?

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        One of the things I've noticed when using the DB table type for a DDT loop (I'm assuming you're doing this in a keyword test) is that once you enter the connection string, you may need to make sure you click the "OK" button the whole way out to save everything down.  Saving just the new connection string and then closing the subsequent windows doesn't trigger the refresh of the connection to gather the new table data.

         

        You may also want to try editing the variable directly rather than going through the DDT loop wizard.  

         

        Have you tried deleting the variable and recreating it with the new string?