Classic ASP connection string for SQL 2005???

Discussion in 'Classic ASP' started by cityphone, Feb 16, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Here is what I'm using, but I can't get it to work. This is in a conn.asp file.

    Set Session("objConn") = Server.CreateObject("ADODB.Connection")
    Session("objConn").Open Session("strDBConnect")
    strDBConnect = "Provider=SQLOLEDB;Data Source=tcp:sql2k512.discountasp.net;database=***;uid=***;pwd=***;"

    Here is my old Access connection string.

    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=E:\web\***\htdocs\_database\***.mdb "

    Thanks, Brian
     
  2. Doing this with a Session object can make it tricky but your actual connection string is correct.
    Try moving the strDBConnect up above the Open statement.
     
  3. Do you know of an easier way to do it? I am open to suggestions. It doesn't have to be a sesson object. I'm using this because I was able to piece it together from bits of code. Ideally I would like something as simple as my old string.


    I will try your suggestion, though.


    Thanks, Brian
     
  4. Thanks for the suggestion, but it didn't work. Is there another way to write the connection string, similar to my old one?


    Thanks, Brian
     
  5. Bruce

    Bruce DiscountASP.NET Staff

  6. My developer was able to find the answer. Thanks, Brian
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page