SQL logon: aspx fails, winform ok

Discussion in 'ASP .Net' started by adam, May 24, 2004.

  1. adam

    adam Guest

    On Thursday it was working, then something changed and now I can't
    access my sql server database from aspx :(

    I have simplified my code to a simple connect and query [1] where m_sql,
    m_con are text boxes and m_output is a label. It fails when I pass in
    either Sql#### or OleDB#### connection and command objects.

    Connection strings
    Ole Db: Provider=SQLOLEDB;Initial Catalog=dbName;Server=MACHINE;User ID=sa;
    Sql : Initial Catalog=dbName;Server=MACHINE;User ID=sa;Integrated
    Security=False;
    OleDb error : OleDbException [DBNETLIB][ConnectionOpen
    (Connect()).]SQL Server does not exist or access denied. Invalid
    connection string attribute
    Sql Error : {System.Data.SqlClient.SqlError}
    Class: 20
    LineNumber: 0
    Message: "SQL Server does not exist or access denied."
    Number: 17
    Procedure: "ConnectionOpen (Connect())."
    Server: ""
    Source: ".Net SqlClient Data Provider"
    State: 0

    This same code runs ok as a win form under my own account. The simple
    project runs fine from some other machines but not all. Aspx runs as
    <MACHINE>\IUSR_<MACHINE>. I do not remember making and security changes
    but obviously must have done.

    I assume that there is some sort of security setting somewhere. I am
    using the sa account in the demo with no password.

    Any hints appreciated.

    adam

    1]
    Public Sub runQuery(ByVal con As IDbConnection, ByVal cmd As
    IDbCommand)
    Try
    m_output.Text = ""
    con.ConnectionString = m_con.Text
    cmd.CommandText = m_sql.Text
    cmd.Connection = con
    con.Open()
    Dim o As Object = cmd.ExecuteScalar()
    m_output.Text = o.ToString()
    con.Close()
    Catch ex As Exception
    m_output.Text = ex.GetType().Name + vbCrLf + ex.Message
    End Try
    End Sub
     
    adam, May 24, 2004
    #1
    1. Advertising

  2. adam wrote:
    > Sql Error : {System.Data.SqlClient.SqlError}
    > Message: "SQL Server does not exist or access denied."
    > Procedure: "ConnectionOpen (Connect())."
    > Source: ".Net SqlClient Data Provider"
    >


    Adam,
    There can be serveral resons why you are getting that error message..
    Check out the following Microsoft KB article for solutions
    http://support.microsoft.com/default.aspx?scid=kb;en-us;328306

    --

    Thanks,
    Carl Prothman
    Microsoft ASP.NET MVP

    Hire top-notch developers at
    http://www.able-consulting.com
     
    Carl Prothman [MVP], May 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. moondaddy
    Replies:
    5
    Views:
    357
    moondaddy
    May 18, 2007
  2. moondaddy
    Replies:
    1
    Views:
    508
    Steven Cheng[MSFT]
    May 18, 2007
  3. Replies:
    0
    Views:
    135
  4. Kjell Kristiansson
    Replies:
    0
    Views:
    289
    Kjell Kristiansson
    Nov 30, 2005
  5. Replies:
    0
    Views:
    176
Loading...

Share This Page