ConnectionString

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RN1

    ConnectionString

    I use SQL Server 2005 Management Studio Express as the database. For
    ASP files to connect to SQL Server 2005, I am using the following
    ConnectionStrin g:

    <%
    Dim objConn
    Set objConn=Server. CreateObject("A DODB.CONNECTION ")
    objConn.Open "Data Source=RON\SQLE XPRESS;Initial
    Catalog=RON;Int egrated Security=True"
    %>

    But ASP generates the following error pointing to the objConn.Open
    line:

    -------------------------------------------------------------------------------
    Multiple-step OLE DB operation generated errors. Check each OLE DB
    status value, if available. No work was done.
    -------------------------------------------------------------------------------

    But when I use the same ConnectionStrin g is ASPX files, no error gets
    generated & I can access records residing in SQL Server 2005
    successfully.

    What could be causing this problem?
  • Bob Barrows [MVP]

    #2
    Re: ConnectionStrin g

    RN1 wrote:
    I use SQL Server 2005 Management Studio Express as the database. For
    ASP files to connect to SQL Server 2005, I am using the following
    ConnectionStrin g:
    >
    <%
    Dim objConn
    Set objConn=Server. CreateObject("A DODB.CONNECTION ")
    objConn.Open "Data Source=RON\SQLE XPRESS;Initial
    Catalog=RON;Int egrated Security=True"
    %>
    >
    But ASP generates the following error pointing to the objConn.Open
    line:
    >
    ----------------------------------------------------------------------
    ---------
    Multiple-step OLE DB operation generated errors. Check each OLE DB
    status value, if available. No work was done.
    ----------------------------------------------------------------------
    ---------
    >
    But when I use the same ConnectionStrin g is ASPX files, no error gets
    generated & I can access records residing in SQL Server 2005
    successfully.
    >
    What could be causing this problem?
    ..Net provider vs OLEDB provider means different connection string.
    You need to specify the provider. Go to www.connectionstrings.com to see
    examples of connetion strings to use.

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Comment

    • RN1

      #3
      Re: ConnectionStrin g

      On Feb 14, 12:41 am, "Bob Barrows [MVP]" <reb01...@NOyah oo.SPAMcom>
      wrote:
      RN1 wrote:
      I use SQL Server 2005 Management Studio Express as the database. For
      ASP files to connect to SQL Server 2005, I am using the following
      ConnectionStrin g:
      >
      <%
          Dim objConn
          Set objConn=Server. CreateObject("A DODB.CONNECTION ")
          objConn.Open "Data Source=RON\SQLE XPRESS;Initial
      Catalog=RON;Int egrated Security=True"
      %>
      >
      But ASP generates the following error pointing to the objConn.Open
      line:
      >
      ----------------------------------------------------------------------
      ---------
      Multiple-step OLE DB operation generated errors. Check each OLE DB
      status value, if available. No work was done.
      ----------------------------------------------------------------------
      ---------
      >
      But when I use the same ConnectionStrin g is ASPX files, no error gets
      generated & I can access records residing in SQL Server 2005
      successfully.
      >
      What could be causing this problem?
      >
      .Net provider vs OLEDB provider means different connection string.
      You need to specify the provider. Go towww.connectio nstrings.comto see
      examples of connetion strings to use.
      >
      --
      Microsoft MVP -- ASP/ASP.NET
      Please reply to the newsgroup. The email account listed in my From
      header is my spam trap, so I don't check it very often. You will get a
      quicker response by posting to the newsgroup.- Hide quoted text -
      >
      - Show quoted text -
      Thanks Bob for the prompt response. I did have a look at
      connectionstrin gs.com before posting my question but couldn't make it
      work.

      I even tried by creating a System DSN by navigating to Start-->Control
      Panel-->Administrati ve Tools-->Data Sources (ODBC) & then using that
      DSN but that didn't work as well. I am using the Windows
      Authentication mode for logging into SQL Server 2005 & used the same
      while creating the DSN.

      I just can't seem to find where am I going wrong. Any other
      suggestions, sir?

      Regards,

      Ron

      Comment

      • Bob Barrows [MVP]

        #4
        Re: ConnectionStrin g

        RN1 wrote:
        On Feb 14, 12:41 am, "Bob Barrows [MVP]" <reb01...@NOyah oo.SPAMcom>
        wrote:
        >RN1 wrote:
        >>I use SQL Server 2005 Management Studio Express as the database. For
        >>ASP files to connect to SQL Server 2005, I am using the following
        >>ConnectionStr ing:
        >>
        >><%
        >>Dim objConn
        >>Set objConn=Server. CreateObject("A DODB.CONNECTION ")
        >>objConn.Ope n "Data Source=RON\SQLE XPRESS;Initial
        >>Catalog=RON;I ntegrated Security=True"
        >>%>
        >>
        Thanks Bob for the prompt response. I did have a look at
        connectionstrin gs.com before posting my question but couldn't make it
        work.
        Show me what you tried and the error message you received. The string
        you tried above is not correct. It needs a "Provider=" attribute which
        you can find at connectionstrin gs. I think it's SQLNCLI but you could
        also use SQLOLEDB. I have not use SQL Express so I'm not sure if you
        need a different provider. The thing is: you HAVE to specify the
        provider in the connection string. Look at the OLEDB examples at
        connectionstrin gs
        >
        I even tried by creating a System DSN
        No no no no no - stay away from ODBC!
        --
        Microsoft MVP -- ASP/ASP.NET
        Please reply to the newsgroup. The email account listed in my From
        header is my spam trap, so I don't check it very often. You will get a
        quicker response by posting to the newsgroup.


        Comment

        • TOUDIdel

          #5
          Re: ConnectionStrin g


          Uzytkownik "RN1" <rn5a@rediffmai l.comnapisal w wiadomosci
          news:254ef523-e81b-48f9-9182-b32861a293b0@v6 7g2000hse.googl egroups.com...
          >I use SQL Server 2005 Management Studio Express as the database. For
          ASP files to connect to SQL Server 2005, I am using the following
          ConnectionStrin g:
          <%
          Dim objConn
          Set objConn=Server. CreateObject("A DODB.CONNECTION ")
          objConn.Open "Data Source=RON\SQLE XPRESS;Initial
          Catalog=RON;Int egrated Security=True"
          %>
          But ASP generates the following error pointing to the objConn.Open
          line:
          try
          Driver={SQL
          Server};Server= localhost\sqlex press;Database= Northwind;Trust ed_Connection=y es
          --
          td


          Comment

          Working...