Database references

Results 1 to 2 of 2

Thread: Database references

  1. #1
    Join Date
    Dec 1969

    Default Database references

    Is there a way to specify an relative location instead of an absolute database location in vb script. For example, rather than specify that the database is located at "c:ApplicationVersion 3DataABC.dbf", I was looking to describe where it was in reference to the current page like you can with HTML images "....Graphicsimage.jpg"

  2. #2
    Join Date
    Dec 1969

    Default Server.MapPath

    Does exactly what you asked.<BR><BR>Suppose your directory structure looks like this:<BR><BR>Application<BR>&nbsp; &nbsp; Version 3<BR>&nbsp; &nbsp; &nbsp; &nbsp; HTML<BR>&nbsp; &nbsp; &nbsp; &nbsp; Data<BR><BR>SO assuming that you are currently executing the page "...HTMLanything.asp", then in that ASP code you can do:<BR><BR>truePath = Server.MapPath("../Data/ABC.dbf")<BR><BR>and truePath will contain "c:ApplicationVersion 3DataABC.dbf".<BR><BR>Server.MapPath treats / and equally, so don&#039;t worry too much about which you use.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts