I been trying to save the results of a Sql query to a txt file from an asp.
I have been using the sample code from Msdn. Basically it goes like this.

db = "MyDB"
Querystring = "Select.."

Chan = SQLOpen ="DSN=" & MyDB
SQLExecQuery Chan, QueryString
SQLRetrieveToFile Chan, "C:\League.txt", true
SQLClose Chan

I get a type mismatch error on the SQLExecQuery line.

The DSN is the same connection string that works on other asp pages, and
so is the querystring.

Any help in this area would be greatly appreciated.

Thanks In advance