Yes, that's what I said in my last post: "UID=root" is my username, with this you will not be able to open your table. Simply remove that and if you don't need the Workstation ID, remove "WSID=...", too (and in the first one, of course remove "Workstation ID=...").
In the connection string you never need to specify an attribute if you don't want to use it. The most of the other attributes are also not needed, only the macro recorder added them. I included them to be sure but for example "APP=Microsoft® Windows® Operating System" only tells the SQL Server which application name to display if you search the connection in the activity monitor.
Next is the DisplayName: It needs to be a name without spaces so "MatTrac_Report" would work. Naming conventions like names in Excel.
And: You can add the following line before the line with ".CommandText ..." in both cases:
.CommandType = Microsoft.Office.Interop.Excel.XlCmdType.xlCmdSql
This makes sure that the command is a query string, it works in both cases.
I saw that I mixed the buttons: ODC starts DSN and vice-versa...:)
Simply change that in the form or in the code.
In both cases it should run now after these changes. In my tests it works in any case.
Cheers,
Christian