locked
Server error, could not find file RRS feed

Answers

All replies

  • User-1716253493 posted
    D:\Grades.mdb is not in folder. This is at the root of d drive. Correct the path.
    Tuesday, August 20, 2013 6:55 PM
  • User1651563574 posted

    I've tried. Regardless of where I put the database I still can't get my program to find it.

    Tuesday, August 20, 2013 8:09 PM
  • User281315223 posted

    Have you tried taking a look at ConnectionStrings.com? It's an excellent resource for accessing information on building and using Connection Strings.

    Based on your example and the Provider being used, it looks like you might be using an Access Database? Which has an example that looks like the following : 

    Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\mydatabase.mdb; User Id=admin; Password=password;

    I would recommend trying a few different options available on there as well to see if you get any improved results. Have you considered storing this Connection String within your web.config file as well?

    <connectionStrings>
          <add name="YourConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb" providerName="System.Data.OleDb" />
    </connectionStrings>

    Tuesday, August 20, 2013 9:17 PM
  • User-1199946673 posted

    Put the mdb in the App_Data folder in the root of your application. Then your connectionstring will be:

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|grades.mdb

    http://www.mikesdotnetting.com/Article/78/AccessDataSource-SqlDataSource-and-connecting-to-Access-databases-in-ASP.NET

    Also make sure you set Modify rights to the App_Data folder

    http://www.mikesdotnetting.com/Article/74/Solving-the-Operation-Must-Use-An-Updateable-Query-error

    By the way

        Dim rs As Object
        Dim s As String
            rs = CreateObject("ADODB.Recordset")
            rs.Open("Module", cs)
            s = ""
            Do Until rs.EOF()
                s = s & rs.Fields("Code").Value & rs.Fields("Description").Value & "<br />"
                rs.MoveNext()
            Loop
            parData.InnerHtml = s
            rs.Close()
            rs = Nothing

    This is really not the way to go, this is how it was done in the old (classic ASP)  days. Start using ADO.NET

    http://www.mikesdotnetting.com/Article/26/Parameter-Queries-in-ASP.NET-with-MS-Access

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 21, 2013 4:11 AM
  • User1651563574 posted

    This is the kind of programming I've been taught so I need to stick with it this way. :/

    I moved my database to the App_Data folder, turned simple file sharing off and enabled the Network Service account.

    It now gives me this error:

    http://puu.sh/47cjJ.png

    The location of my vb project is in D: -> Users -> Me -> My Documents -> Visual Studio 2010 -> Projects -> Cwk

    whereas the location of my database is

    D: -> Windows -> Microsoft.NET -> Framework -> v4.0.30319 -> ASP.NETWebAdminFiles -> App_Data

    Also, when looking through my folders, I have a number of different App_Data folders in various places (v4.0.30319, v2.0.50727, C drive, D drive, etc).

    Wednesday, August 21, 2013 8:17 AM
  • User-1199946673 posted

    SupernovaX360A

    This is the kind of programming I've been taught so I need to stick with it this way. :/

    Really? I was taught to do this also in the classic ASP days! But in .NET, this is NOT the way you should do it! If you want to learn ASP.NET, start doing things the .NET way. In this case, start using ADO.NET and not ADO

    http://msdn.microsoft.com/en-us/library/h43ks021(v=vs.100).aspx

     

    Wednesday, August 21, 2013 8:52 AM
  • User-1199946673 posted

    SupernovaX360A

    The location of my vb project is in D: -> Users -> Me -> My Documents -> Visual Studio 2010 -> Projects -> Cwk

    whereas the location of my database is

    D: -> Windows -> Microsoft.NET -> Framework -> v4.0.30319 -> ASP.NETWebAdminFiles -> App_Data

    I said to put the database in the App_Data folder in the root of your application!!!

    D: -> Users -> Me -> My Documents -> Visual Studio 2010 -> Projects -> Cwk -> App_Data --> Yourdatabase.mdb

    http://msdn.microsoft.com/en-us/library/ex526337(v=vs.100).aspx

    Wednesday, August 21, 2013 8:56 AM
  • User1651563574 posted

    I know you did, there is no App_Data folder there though.

    http://puu.sh/47dKy.png

    Those are the only places where there is an App_Data folder, there are none in my Visual Studio 2010 folder anywhere.

    Wednesday, August 21, 2013 9:04 AM
  • User-1199946673 posted

    SupernovaX360A

    there is no App_Data folder there though.

     

    And you can't create one? I think you better start reading the links I gave you... In the last article, among others, the ASP.NET Web Project Folder Structure is ecplained, It also tells what the App_Data folder is for. 

    Wednesday, August 21, 2013 9:19 AM
  • User1651563574 posted

    Just tried making one but I ended up with the same error message.

    http://puu.sh/47elx.png

    Wednesday, August 21, 2013 9:23 AM
  • User-1199946673 posted

    And then you change your code something like:

    Dim sb As New System.Text.StringBuilder
    Using conn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|grades.mdb")
      Using cmd As New System.Data.OleDb.OleDbCommand("SELECT ... FROM ....")
        Try
          conn.Open()
          Dim reader As System.Data.OleDb.OleDbDataReader = cmd.ExecuteReader()
          While reader.Read()
            sb.Append(reader.Item("code"))
            sb.Append(reader.Item("description"))
            sb.Append("<br />")
          End While
        Catch ex As Exception
    
        End Try
      End Using
    End Using
    parData.InnerHtml = sb.ToString()


     

     

    Wednesday, August 21, 2013 9:36 AM