Forum Discussion
raluca_suditu
13 years agoContributor
Hello again,
I found the solution in the help files and I did like this:
I found the solution in the help files and I did like this:
function
GetLastDatabase()
{
var Qry;
// Create a query
Qry =
ADO["CreateADOQuery"]();
// Specify the connection string
Qry["ConnectionString"] = "Driver={SQL Server};Server=xxx;Uid=xxx;Pwd=xxx";
// Specify the SQL expression
Qry["SQL"] = "select name from sys.databases where name like :Database_Name";
// Execute the query
// Specify the parameter value
Qry["Parameters"]["ParamByName"]("Database_Name")["Value"] = xxx_%';
Qry["Open"]();
// Process results and insert data into the test log
Qry["First"]();
while (!Qry["EOF"])
{
var result=Qry["FieldByName"]("name")["Value"];
Qry["Next"]();
}
// Closes the query
Qry["Close"]();
Log["Message"](result)
return result;
}
Regards,
raluca
Related Content
- 2 years ago
- 9 years ago
Recent Discussions
- 2 days ago