where should i put my database file?

Discussion in 'Databases' started by sody, Jun 21, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. This is an asp.net file. Here is the error:

    ====
    'e:\web\sodypopzcom\htdoc\XXXXX\XXXX.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
    ====
    And this is part of my code:
    ====
    ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=e:\web\sodypopzcom\XXXX\*****\XXXX.mdb"
    ====

    Why can't it find the access database file? It works on my window machine, however, it is a lot easier on my windows machine because I know exactly where to direct it to my database (i.e. C:\xxxx.mdb).
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Try use server.mappath function

    for example, server.mappath("/") will return the physical path to the root.


    quote:Originally posted by sody

    This is an asp.net file. Here is the error:

    ====
    'e:\web\sodypopzcom\htdoc\XXXXX\XXXX.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
    ====
    And this is part of my code:
    ====
    ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=e:\web\sodypopzcom\XXXX\*****\XXXX.mdb"
    ====

    Why can't it find the access database file? It works on my window machine, however, it is a lot easier on my windows machine because I know exactly where to direct it to my database (i.e. C:\xxxx.mdb).
    </blockquote id="quote"></font id="quote">
     
  3. Thank you Bruce for your reply! =) I am still having problems. After applying your suggestion, I receive the following error (btw, I am using Webmatrix):

    ****
    Parser Error Message: The server tag is not well formed.

    Source Error:
    Line 13: <form runat="server">
    Line 14: <p>
    Line 15: <wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server" SelectCommand="SELECT * FROM [Phone Number]" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source= & server.mappath("/xxxx.mdb") ></wmx:AccessDataSourceControl>
    Line 16: </p>
    Line 17: <p>

    ****
    I also added the database to the root folder after taking in your suggestion. Again, thank you Bruce for your response :)

    Sody
    ===
    quote:Originally posted by bruce

    Try use server.mappath function

    for example, server.mappath("/") will return the physical path to the root.


    quote:Originally posted by sody

    This is an asp.net file. Here is the error:

    ====
    'e:\web\sodypopzcom\htdoc\XXXXX\XXXX.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
    ====
    And this is part of my code:
    ====
    ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=e:\web\sodypopzcom\XXXX\*****\XXXX.mdb"
    ====

    Why can't it find the access database file? It works on my window machine, however, it is a lot easier on my windows machine because I know exactly where to direct it to my database (i.e. C:\xxxx.mdb).
    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    I don't believe you can embed any function into a server control.

    I guess you have to resort back to the physical path, after reviewing the original post, i think you are missing an 's' in htdoc in your path


    quote:Originally posted by sody

    Thank you Bruce for your reply! =) I am still having problems. After applying your suggestion, I receive the following error (btw, I am using Webmatrix):

    ****
    Parser Error Message: The server tag is not well formed.

    Source Error:
    Line 13: <form runat="server">
    Line 14: <p>
    Line 15: <wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server" SelectCommand="SELECT * FROM [Phone Number]" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source= & server.mappath("/xxxx.mdb") ></wmx:AccessDataSourceControl>
    Line 16: </p>
    Line 17: <p>

    ****
    I also added the database to the root folder after taking in your suggestion. Again, thank you Bruce for your response :)

    Sody
    ===
    quote:Originally posted by bruce

    Try use server.mappath function

    for example, server.mappath("/") will return the physical path to the root.


    quote:Originally posted by sody

    This is an asp.net file. Here is the error:

    ====
    'e:\web\sodypopzcom\htdoc\XXXXX\XXXX.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
    ====
    And this is part of my code:
    ====
    ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=e:\web\sodypopzcom\XXXX\*****\XXXX.mdb"
    ====

    Why can't it find the access database file? It works on my window machine, however, it is a lot easier on my windows machine because I know exactly where to direct it to my database (i.e. C:\xxxx.mdb).
    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">
     
  5. THANK YOU SO MUCH BRUCE!!! [:)]

     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page