I am experimenting with executing SQL Server stored procedures on a SQL Server back end from Access via DAO / ADO.
I can get it working quite well in DAO by using a pass-through query with a connection string to an ODBC data source When I try to use the same connection string on an ADO Connection object however, I just get the message:
Error -2147467259: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (Microsoft OLE DB Provider for ODBC Drivers)
The connection string that worked with DAO was a pointer to a DSN file: "ODBC;FILEDSN=RISCGen2.dsn".
Thinking that ADO might not be able to digest this, I tried replacing the string with the relevant content from the DSN file, namely:
“ODBC;DRIVER={ODBC Driver 11 for SQL Server};UID=my.loginid;PWD=mypassword;SERVER=WYNRISC08;Database=RISCGen2”.
However, I am still getting the same error.
Can someone spot where I am going wrong with this? Thanks in advance.
ADDENDUM
Dan Guzman has answered the question I posed. The problem has now become one of understanding certain messy details about ADO's way of doing things. I am thinking I will need to ask another question to deal with it...New question posted : Execute SQL stored procedure from VBA and retrieve all messages and result sets