Can't login from internet

Posted on 2007-08-03
Last Modified: 2010-04-23
I have created a web using VB 2005 that uses ASPNETDB.MDF. I can login when running in debug but not through the net . I get this error when running through the net
Server Error in '/' Application.
Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'
I suspect it has something to do with permissions. Can anyoone help?
Question by:whiwex
    LVL 4

    Accepted Solution

    You've created a web?

    Also, a .MDF indicates that it's a MS Access database file.  If that's the case, then how do you expect to access it through the net?  MS Access would have to have a third party "server" software for it to be accessible through the internet.

    LVL 48

    Assisted Solution

    Javin007 MDF is SQL database not Access (mdb).  But your question makes sense: Does your server (where you store the database) as support to SQL ? And does you connection string are ok ?
    LVL 4

    Expert Comment

    Ah, I stand corrected.  Thanks, Jpaulino.  :)


    Author Comment

    Found this and it fixed it

    First of all, if the ASPNET account is missing on your system, I'd advice the following steps (Note: Your account must be a member of the Administrators group!):

    1. Start Notepad. Verify that Word Wrap is turned off
    2. Paste this code in Notepad:

    @echo off
    echo "Stopping IIS."
    iisreset /stop
    echo "----------------------"
    echo "Stopping ASP.NET State Service!"
    net stop aspnet_state
    echo "----------------------"
    echo "Creating a new ASPNET account with a temporary password."
    net user ASPNET 1pass@word /add
    echo "----------------------"
    echo "Creating a profile."
    echo "Type 1pass@word when you are prompted for the temporary password."
    runas /profile /user:ASPNET cmd.exe
    echo "----------------------"
    echo "Reregistering ASP.NET and the ASPNET account."
    aspnet_regiis -i
    echo "A new random password has been autocreated for the ASPNET account."
    echo "----------------------"
    echo "Restarting IIS."
    iisreset /start
    echo "----------------------"
    echo "You should have your ASPNET account now, sbasha ;-)"

    3. Save the file as c:\createASPNETuser.cmd
    4. Click Start, and then click Run
    5. Type cmd.exe, and then press ENTER
    6. At the command prompt, type c:\createASPNETuser.cmd, and then press ENTER
    7. When you are prompted for a password, type 1pass@word
        -> A second command prompt window appears!
    8. After you apply this patch, type exit in the second command prompt window, and then press ENTER

    With step 8. you've added a ASPNET account on your system which you can add (as user) to the appropriate database ...

    ... but we're not done yet ... ;-) ...

    ... under Windows Server 2003, the NT AUTHORITY/NETWORK SERVICE database user is part of the IIS Worker Process Group. In the SQL Server Login Properties not only click on add "ASPNET" to add this user as a Login for the selected database. You'll also have to give rights to the "NT AUTHORITY/NETWORK SERVICE" user, which was the user that your ASP.NET web application tried to use to access your database ... one of the reasons for your question!

    Best regards,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now