Error with SQL Server

  • Hello,

    excuse me for my english, but I'm an italian boy. I have a problem with SQL Server. I have SQL Server Personal Edition. There is only a account of "Administrator" setting with "account Windows" and not "account for SQL Server". When I try to esecute an asp page to access to a database "Prova", there is the error :

    Microsoft OLE DB Provider for SQL Server (0x80040E4D)

    Impossibile eseguire l'accesso per l'utente 'Administrator'.

    Why ?? Thank you.

  • No sure what the message means since it is in Italian. My guest was there may be problemw with ASP data connection. Make sure the connection have right to access the SQL DB.

  • In the asp page there is the following code :

    Dim ADOConn

    Set ADOConn = Server.CreateObject("ADODB.Connection")

    Dim strSQLServerName,strSQLDBUserName,strSQLDBPassword,strSQLDBName

    strSQLServerName = "localhost"

    strSQLDBUserName = "sa"

    strSQLDBPassword = ""

    strSQLDBName = "Prova"

    'assegno la stringa di connessione

    ADOConn.ConnectionString = "Provider=SQLOLEDB" & _

    ";Data Source=" & strSQLServerName & _

    ";User ID=" & strSQLDBUserName & _

    ";Password=" & strSQLDBPassword & _

    ";Initial Catalog=" & strSQLDBName & ";"

    'apro la connessione al database

    ADOConn.Open()

  • The error means that it is not possible to access the database with user 'administrator'.

    First of all, it is a very very bad practice to have a blank password for sa.

    You must change it to a stronger password.

    Second, never access your database from web with the sa password.

    Create a new user. Open Enterprise manager go to "security", right click logins and create a new user (with a password). Then still in EM go to your "database/users", right click it and select "new database user". You will see a combo box with all the users including the one you created. Add it to the database.

    From this point on, access the database with that user and NEVER with sa.

    change strSQLServerName from localhost to the the server name.

    Now the only thing left for you will be to manage permissions. for each stored procedure you will call with that user, you will have to set the permissions.

    you will have to run from query analyzer the following command

    GRANT EXECUTE ON stored_procedure_name TO user_name_you_created

    Se hai ancora bisogno di qualcosa, mi puoi scrivere a bambolarosa@hotmail.com.

    Bambola.

  • I have posted the wrong code, I don't access to database with user sa but I try to access with Administrator. If I create a new user with access "SQL Server" .... it's all ok, but not with Administrator. Why ?

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply