Forum Discussion

lucky_star's avatar
lucky_star
Occasional Contributor
8 years ago
Solved

How to use variable in Data Source field of DBTables Collection object

Hi all,

 

Current I use DBTables Collection object to create a checkpoint. The 'Connection' string require to input the 'Data Source' is my current Server Name.
When the Server Name is changed, I must to change 'Data Source' for other Server Name in each DB Tables.

 

So, how can I use variable for 'Data Source' field ? It's will be easier for me to edit when set variable Data Source value in Persistent Variable.

 

Thanks for you helping,

 

 

 

 

  • Hi,

     

    The "Connection" for the datasource you are using for DBtable needs to be changed manually as it does not store it in a variable unless you are creating the checkpoint via script that way you can possibly store it in a variable to be called but you will still need to modify the variable value. Please see https://support.smartbear.com/viewarticle/70630/ for further information

     

    I would however recommend in the "stores" section of TestComplete, modify the DBTables value you want to change. This will then propagate down to where this is referenced in the various scripts

     

    I hope this helps

     

    Regards

    Damien

     

    Technical Sales Engineer

2 Replies

  • Hi,

     

    The "Connection" for the datasource you are using for DBtable needs to be changed manually as it does not store it in a variable unless you are creating the checkpoint via script that way you can possibly store it in a variable to be called but you will still need to modify the variable value. Please see https://support.smartbear.com/viewarticle/70630/ for further information

     

    I would however recommend in the "stores" section of TestComplete, modify the DBTables value you want to change. This will then propagate down to where this is referenced in the various scripts

     

    I hope this helps

     

    Regards

    Damien

     

    Technical Sales Engineer

    • lucky_star's avatar
      lucky_star
      Occasional Contributor

      Thanks for your helping! :smileyhappy:

      It was successful.