Error thrown when I am trying to restore my local DB using ADO object available in Testcomplete
Here is my full script
(Written in Jscript)
var con,query,result; con=ADO.CreateADOConnection(); con.ConnectionString = "Provider=SQLNCLI11;Server=mylocalserver;Database=MyLocalDB;Integrated Security=True;DataTypeCompatibility=80;Uid=sa;Pwd=123123;"; con.Open(); query=ADO.CreateADOQuery(); query.SQL="RESTORE DATABASE MyLocalDB FROM DISK = 'C:\\Test\\TestsBackup\\Data\\DB\\MyLocalDB.bak' WITH REPLACE"; query.Active=con; result=query.ExecSQL(); con.Close();
When executing throws an below error,
a) The message does not say that ADO cannot connect to the database. It says that the system is out of resources. It's better to reboot.
b) ADO Query object assumes that a recordset is returned, while your SQL will not return a recordset. Not sure about ADO wrapper in TestComplete, but in 'pure' ADO you should use Command object instead of Recordset in this case.
Thanks for sharing your suggestions, Alex.
@DKumar04, did Alex reply help you overcome the error message? If it did, please accept his reply as a solution.
As one of possible options: https://support.smartbear.com/viewarticle/8968/