How to pass in a parameter to DB connection string
var Qry = ADO.CreateADOCommand()
Qry.ConnectionString = "Provider=PROVIDERDB;Data Source=SOURCEADDRESS;Initial Catalog=MYDBNAME;User ID=USERID;Password="+ProjectSuite.Variables.sqlReadOnlyPWDINT+";";
Qry.CommandText = Query;
Qry.commandType = cmdText;
var RecordSet = Qry.Execute();
return RecordSet;
This structure is not working for me . I am not able to get the sqlReadOnlyPWDINT passed down to connection string unless its stored as string instead of password.
Either I need to hardcode it in my script or store it as variable of SRTING type for this connection string to work. Neither of them will satisfy my risk team. Any solution to this problem?
A while back, I provided a possible solution, see Encrypt/Decrypt Base64 string in TestComplete | SmartBear Community - I didn't have dotNet extension installed or the appropriate license, so I was unable to provide the full code. However, the snippet of code was able to help. You could implement something similar.
If the automation scripts is being used by a team, would it not be best to have a dedicated user account to access the database?