PDA

View Full Version : where should i put my database file?


sody
06-21-2003, 02:35 AM
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).

bruce
06-21-2003, 07:48 AM
Try use server.mappath function

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


[b]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">

sody
06-22-2003, 12:31 AM
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
===
[b]quote:Originally posted by bruce

Try use server.mappath function

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


[b]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">

bruce
06-22-2003, 10:34 AM
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;[b] 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
===
[b]quote:Originally posted by bruce

Try use server.mappath function

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


[b]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">

sody
06-23-2003, 03:43 AM
THANK YOU SO MUCH BRUCE!!! [:)]

[quote]Originally posted by bruce

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