cpopham Posted September 5, 2004 Posted September 5, 2004 I have a nice little Access 2000 database. I am currently using it on my local machine with my ASP .net app. It works great on my local machine, but I am getting ready to upload the database and ASP app to a regular web server. My problem is that on my local machine I set the Data Path to C:\MyProject\Databases\schedule.mdb. Now I have tried ...Path=\Databases\schedule.mdb, but No matter what I try, it will not work unless I have my path start at the root of C:. What do I need to change and how do I need to change it to get this to work on the webserver after upload??? I thought maybe server.mappath, but that says that I have to have a virtual driectory or something, so anyone have any ideas? Thanks, Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
cpopham Posted September 7, 2004 Author Posted September 7, 2004 No one has any ideas? Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
tate Posted September 7, 2004 Posted September 7, 2004 Will you be using a web host server or will it be a IIS server you have set up? Quote
*Experts* Bucky Posted September 7, 2004 *Experts* Posted September 7, 2004 Ooh! Ooh! I know this one! *raises his hand* Request.PhysicalApplicationPath (I think that Server.MapPath("") would work, also) :) Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Moderators Robby Posted September 7, 2004 Moderators Posted September 7, 2004 Yes it would... Quote Visit...Bassic Software
cpopham Posted September 7, 2004 Author Posted September 7, 2004 It will be on a web host server. So how do I set up the Request.PhysicalApplicationPath ? And thanks for the help! :) Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
*Experts* Bucky Posted September 7, 2004 *Experts* Posted September 7, 2004 You don't do anything to set it up; it's a property. Just make sure that all your physical paths you use (to find the database file and such) contain this property (or some form of it). Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
cpopham Posted September 7, 2004 Author Posted September 7, 2004 The path where the database is located is: myProject\Database\NWind.mdb I am going to upload the Database\NWind.mdb folder to the Web Server and the aspx file will be under the myProject folder. So would it be: Data Source=Request.PhysicalApplicationPath = "database\Nwind.mdb" ? Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
*Experts* Bucky Posted September 7, 2004 *Experts* Posted September 7, 2004 You're close; use + (or & in VB) to concatenate the strings: Data Source=Request.PhysicalApplicationPath &"database\Nwind.mdb" Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
cpopham Posted September 7, 2004 Author Posted September 7, 2004 Thank you for the help... Coding Windows apps with VB .NET is easier than coding ASP .NET web Apps. A lot more things to consider :) Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
*Experts* Bucky Posted September 7, 2004 *Experts* Posted September 7, 2004 Yes, it is a different way of thinking, but not nearly as difficult as classic ASP (in terms of transitioning). VBScript... ick Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
tate Posted September 7, 2004 Posted September 7, 2004 Make sure to check with your web host to determine if they have any restrictions. I use a web host that requires all database files to be placed in a specific folder that they set up for you like "_database". If I try to use some other path the web form will not function correctly. Quote
Moderators Robby Posted September 8, 2004 Moderators Posted September 8, 2004 Good point Tate, there are some that even place the Database folder outside your root application directory. Usually at the same level. In that case they will give you the physical path of the location. Quote Visit...Bassic Software
cpopham Posted September 8, 2004 Author Posted September 8, 2004 Thanks, I will do ask them :) Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.