DSN: Syntax for Opening Connection with SQLConnect

Results 1 to 2 of 2

Thread: DSN: Syntax for Opening Connection with SQLConnect

  1. #1
    Anita Kilgore Guest

    Default DSN: Syntax for Opening Connection with SQLConnect

    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&#039;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&#039;t supported in ASP.NET, it would be grately apprecitated. Thanks!

  2. #2
    Decrypted Guest

    Default RE: DSN: Syntax for Opening Connection with SQLCon

    I doon&#039;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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts