I want to use code to connect Excel to an SQL database. I have successfully made this connection using MSQuery and have copied the SQL statement and the connection string to use in the code.
Const CERMCONN for the connection and
BuildSQL for the SQL String
As you can see I have simplified the SQL String as far as I can.![]()
Please Login or Register to view this content.
I get an error at the line Set qtTAPEO = Sheets(SheetName).QueryTable.Add(CERMCONN, rngTape, strSQL)
My question is how should I proceed to find if it is the SQL string or the Connection line that is giving the error
John
Bookmarks