JonoW
13 years agoOccasional Contributor
File DSN help, please.
Hi,
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
Qry["Open"]();
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.
It's all running on 32 bit O/S too...
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
Qry["Open"]();
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.
It's all running on 32 bit O/S too...