I am using a VB dll in my ASP to connect to a SQL database and I get the error: The connection cannot be used to perform this operation. It is either closed or invalid in this context.<BR><BR>I don't get it, because I tried using the code to connect to the database straight in the ASP page and that works fine. But when I put it in a DLL and then it errors. I have other code in the DLL that is working fine, and I am able to connect to an ACCESS database through the DLL just fine.<BR>One thing is that I am using ADO. However I use ADO for the ACCESS database connection and that works fine. I close the connection then try the same for the SQL connection and I get the error.<BR>The code in the DLL to connect is:<BR>conDSN.Provider="MSDASQL"<BR>conDSN.Connect ionString="DSN=" & strDSN & ";UID=sa;"<BR>conDSN.open<BR>Any ideas would be very much appreciated.