I've been using a User or System DSN for my DB connection in tests, so far and it's been working great.
I can't create a user DSN on other machines that will be running the tests via TestExecute, so I'd like to use a File DSN, then check that into the source repository and then everyone should be able to use it; they'll all have the same drivers that are required.
My question is - HOW do I use a File DSN in the connection after I've created it?
var Qry, FoundCR;
// Create a query
Qry = ADO["CreateADOQuery"]();
// Specify a Connection string - currently uses SystemDSN
Qry["ConnectionString"] = "Provider=MSDASQL;Persist Security Info=False;Data Source=Recipes";
// Specify the SQL expression - Cluster Recipe Name passed in from outside
Qry["SQL"] = "Select max(ID) as ID from ClusterRecipes where Name = '" + CRName + "'";
// Execute the Query
This worked fine... but adding ".dsn" onto the end of Recipes doesn't work.
I'm not sure where the .dsn file should reside. I've put it in the scripts folder, and pointed ODBC data sources at it ... but still no joy.
Is anyone able to help me with this? Hopefully it's something simple. The Connection Test works fine from the ODBC manager, so the dsn itself seems ok.
I believe the question is more related to connection strings and data providers than to TestComplete. I recommend that you try finding a connection string which allows specifying the needed DSN on the following web site: http://connectionstrings.com/