Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

____________________________________________

http://www.pophamcafe.com

I am starting a developers section, more tutorials than anything.

  • *Experts*
Posted

Ooh! Ooh! I know this one! *raises his hand*

 

Request.PhysicalApplicationPath

 

(I think that Server.MapPath("") would work, also)

 

:)

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

  • *Experts*
Posted

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).

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted

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

____________________________________________

http://www.pophamcafe.com

I am starting a developers section, more tutorials than anything.

  • *Experts*
Posted

You're close; use + (or & in VB) to concatenate the strings:

 

Data Source=Request.PhysicalApplicationPath &"database\Nwind.mdb"

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted

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

____________________________________________

http://www.pophamcafe.com

I am starting a developers section, more tutorials than anything.

  • *Experts*
Posted

Yes, it is a different way of thinking, but not nearly as difficult as classic ASP (in terms

of transitioning). VBScript... ick

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted
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.
  • Moderators
Posted
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.
Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...