Java script Code for restore database
I write this script for restore database. But getting the error -Login failed for user 'fastreact' .
function To_Restore_DB_FR4()
{
if(Aliases.FR4.Exists)
{
Aliases.FR4.Terminate()
}
var query = "RESTORE DATABASE FR4_Manual_Regression_Apparel FROM DISK = 'C:\\Automation DBs\\FR4_Manual_Regression_Apparel.bak' WITH REPLACE, RECOVERY;"
var AConnection, RecSet;
//Create connection
AConnection = ADO.CreateADOConnection();
//Get the machine name
Source_name=Sys.HostName
//Connection string from Test Complete.
AConnection.ConnectionString = AConnection.ConnectionString = "Provider=SQLOLEDB.1;Initial Catalog=master;Data Source="+Source_name+"\\SQLEXPRESS;User Id=fastreact;Password=";
AConnection.LoginPrompt = false;
AConnection.Open();
Delay(2000)
// Execute a simple query
RecSet = AConnection.Execute_(query);
//Close DB connection
AConnection.Close();
Delay(2000)
}
Not able to debug what is the exact issue .Also these steps are running manually at my side .
Database is master and User fastreact is there .There is no password set for this.