Forum Discussion

Marsha_R's avatar
Marsha_R
Champion Level 3
10 years ago
Solved

how to make the connection path for a DBTable generic

When we give the DBTable a hard coded path, the connection works fine, but when we try to use system variables, somehow the project path ends up in there and then the connection fails.  See attached screenshots.  (I realize the document name is missing from the path in the second screenshot but the connection fails the same way regardless.)



We'd like to make this connection path more generic - any suggestions?





  • Hi Marsha,

     


    TestComplete accepts only the string in this field. Thus, it doesn't parse the environment variable you specified correctly.


    You can update the connection string from script as it's specified here or set it via the DBTable.ConnectionString property.


     


    BTW, we have a suggestion to improve the Connection field in the DBTable element so that it accepts variables. I've increased its rating based on your questions.


     

4 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Marsha,

     


    TestComplete accepts only the string in this field. Thus, it doesn't parse the environment variable you specified correctly.


    You can update the connection string from script as it's specified here or set it via the DBTable.ConnectionString property.


     


    BTW, we have a suggestion to improve the Connection field in the DBTable element so that it accepts variables. I've increased its rating based on your questions.


     

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3
    Would that then overwrite the connection in the Edit window for the DBTable or do I just leave it out? 



    Also, I didn't see a keyword test example.  How would I use the connection property?