DSN: Syntax for Opening Connection with SQLConnect

delux

New Member
Does anyone know if a DSN can be substituted for an explicit connection string when you create a new SQLConnection object? I tried using:<BR><BR>dnConn As New SQLConnection(DSN=mydnsname)<BR><BR>but this produced an error. When I explicitly define connection parameters, my aspx pages compile just fine. For example:<BR><BR>dbConn As New SQLConnection("server=localhost;database=pubs;uid=sa;pwd=")<BR><BR>works just fine. I looked in the MSDN .NET Reference and DSN=whatever isn't listed as an acceptable parameter. I would rather not have to hardcode the database password and user id. If someone can suggest a work around or at least explain to me why using a DSN to open a connection isn't supported in ASP.NET, it would be grately apprecitated. Thanks!I doon't know the technicalities of it but I do know that from experience you have to define you connection for a SQLDB, but an access db only requires the reference to the name. I believe it has something to do with the way ODBC registers an instance of an MS Access DB connection. This is just a guess though, and not a very educated one I might add =P<BR>As far *** hardcoding your connection strings, sorry mate, but your stuck
 
Top