Forum Discussion
Look at the TC examples here: http://support.smartbear.com/viewarticle/56911/
Using the ADO object works fine for me. In the exxample below I pass in a SQL query. I have another function that builds SQL queries for me to pass into this..
function query (sqlQuery) {
var dbObj = ADO.CreateADOQuery();
dbObj.ConnectionString = //your connection string here
dbObj.SQL = sqlQuery;
dbObj.Open();
queryResult = dbObj;
return queryResult;
}
here is my code and it is not working...
Sub SQLServer
Set dbObj = ADO.CreateADOQuery()
dbObj.ConnectionString = mil-tfsprd-01
dbObj.Open()
End Sub
- chrisb10 years agoRegular Contributor
You are not doing any SQL query on the database! In the example below I have hardcoded a generic SQL query in for you to modify, you would most likely want to add a parameter to your function and pass the query in, but this should do for now.
Sub SQLServer
Set dbObj = ADO.CreateADOQuery()
dbObj.ConnectionString = mil-tfsprd-01dbObj.SQL = "Select * FROM yourcolumn WHERE avalue = something";
dbObj.Open()End Sub
Your connection string looks odd, take a look at the link I posted above. That site has lots of information about how a connection string should be formatted. Check with your app developers they may well know the correct connection string if your app is having to connect to the database.
Related Content
- 3 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 7 days ago