WillClarke
8 years agoOccasional Contributor
Is there a way to update a single record in SQL by based on passing in a variable from the test case
For example, before my test, I need to disable an account so that I can test to make sure I cannot login with that username / password. I would need to run SQL like the below.
update useraccounts set accountlocked = 1 where username = 'usernamevar'
My google-fu and general searching did not find anything really applicable and could use some assistance. Thanks
SQL Queries can be run using the ADO objects built in to TestComplete specifically the CreateADOQuery method. Follow the link and it will give you some examples of what to do.
If you want something a bit more built in, I have a script extension I wrote that puts some wrappers around it. You can down load it here . If you need help implementing that extension, let me know via PM.