Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2011
    Posts
    10

    Unanswered: ASP Connection String to MS SQL DB

    I was wondering if anyone knew the conenction string to a MS SQL Database. I have only used a MS Access DB before when utilizing ASP and have never played around with the MS SQL Database.

    Thanks In Advance

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,469
    Provided Answers: 10
    much the same as msaccess
    I would put this into a INC file

    set connstring = Server.CreateObject("ADODB.Connection")
    connstring.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog = [Catalogname];User Id =[SQLLOGNAME]; Password=[ITSPASSWORD]"
    Const adOpenKeyset = 1
    Const adLockPessimistic = 2
    Const adCmdText = &H0001

    I don't like using the SA login


    then in the page

    <!-- #include file="inc/ddd.asp" -->

    Set rsList = Server.CreateObject("ADODB.Recordset")
    SQLL = "SELECT Society.Society FROM Society " & Get_Where_Society & " "
    rsList.Open SQLL, connstring, adOpenKeyset, adLockPessimistic, adCmdText

    adOpenKeyset = 1
    adLockPessimistic = 2
    adCmdText = &H0001
    Last edited by myle; 04-13-11 at 06:15. Reason: spelling
    hope this help

    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
    DONT WORRY ABOUT THOSE WHO TALK BEHIND YOUR BACK
    THEY'RE BEHIND YOU FOR A REASON

Posting Permissions

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