Forum Discussion
here is my code and it is not working...
Sub SQLServer
Set dbObj = ADO.CreateADOQuery()
dbObj.ConnectionString = mil-tfsprd-01
dbObj.Open()
End Sub
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-01
dbObj.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
- 14 hours ago