Professional Web Applications Themes

Server.MapPath() error 'ASP 0172 : 80004005' - ASP Database

I receive an error like this: Server.MapPath() error 'ASP 0172 : 80004005' Invalid Path /conn.asp, line 2 The Path parameter for the MapPath method must be a virtual path. A physical path was used. the conn.asp code : <% cst = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ Server.MapPath("Z:\AccessDB\access.mdb") set conn = CreateObject("ADODB.Connection") conn.open cst %> Do I need to locate the mdb file inside the wwwroot? how about enable web sharing on the Z:\AccessDB, is this required even though I set change permission on IUSR account?...

  1. #1

    Default Server.MapPath() error 'ASP 0172 : 80004005'

    I receive an error like this:
    Server.MapPath() error 'ASP 0172 : 80004005'

    Invalid Path

    /conn.asp, line 2

    The Path parameter for the MapPath method must be a virtual path. A physical
    path was used.



    the conn.asp code :

    <%
    cst = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
    Server.MapPath("Z:\AccessDB\access.mdb")
    set conn = CreateObject("ADODB.Connection")
    conn.open cst
    %>

    Do I need to locate the mdb file inside the wwwroot? how about enable web
    sharing on the Z:\AccessDB, is this required even though I set change
    permission on IUSR account?


    A Guest

  2. #2

    Default Re: Server.MapPath() error 'ASP 0172 : 80004005'

    The problem is, you've used a physical path, and not a virtual one, just as
    the message says.....

    Either remove Server.MapPath(), or change the path to a virtual one.....
    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!


    "A P" <ph> wrote in message
    news:#phx.gbl... 
    physical 


    Steven Guest

  3. #3

    Default Re: Server.MapPath() error 'ASP 0172 : 80004005'

    i remove server.mapPath() like this:

    <%
    cst = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\DB\access.mdb;"
    set conn = CreateObject("ADODB.Connection")
    conn.open cst
    %>

    the next error is this:

    Microsoft JET Database Engine error '80004005'
    Could not find file 'Z:\DB\access.mdb'.

    /cn.asp, line 4



    "Steven Burn" <com> wrote in message
    news:phx.gbl... 
    as 
    > physical [/ref]
    web 
    >
    >[/ref]


    A Guest

  4. #4

    Default Re: Server.MapPath() error 'ASP 0172 : 80004005'

    Is the path to the file correct?

    If so, take a look at;

    www.connectionstrings.com

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!


    "A P" <ph> wrote in message
    news:phx.gbl... 
    > as 
    > > physical [/ref]
    > web 
    > >
    > >[/ref]
    >
    >[/ref]


    Steven Guest

  5. #5

    Default Re: Server.MapPath() error 'ASP 0172 : 80004005'

    A P wrote: 

    Is Z a local drive or a mapped drive to a remote machine?

    http://www.aspfaq.com/show.asp?id=2009

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Guest

  6. #6

    Default Re: Server.MapPath() error 'ASP 0172 : 80004005'

    See my answer in your other thread. Stick to one thread and pay
    attention to the error messages.

    Jeff

    On Thu, 26 Aug 2004 12:36:37 +0800, "A P" <ph> wrote:
     
    >as 
    >> physical [/ref]
    >web 
    >>
    >>[/ref]
    >[/ref]

    Jeff Guest

  7. #7

    Default Re: Server.MapPath() error 'ASP 0172 : 80004005'

    Also see http://www.aspfaq.com/2168

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Bob Barrows [MVP]" <SPAMcom> wrote in message
    news:phx.gbl... 
    >
    > Is Z a local drive or a mapped drive to a remote machine?
    >
    > http://www.aspfaq.com/show.asp?id=2009
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >[/ref]


    Aaron Guest

  8. #8

    Default Re: Server.MapPath() error 'ASP 0172 : 80004005'

    Hi Bob/Aaron!

    Z is on my local drive.

    Mark

    "Aaron [SQL Server MVP]" <noraa> wrote in message
    news:phx.gbl... 
    > >
    > > Is Z a local drive or a mapped drive to a remote machine?
    > >
    > > http://www.aspfaq.com/show.asp?id=2009
    > >
    > > --
    > > Microsoft MVP - ASP/ASP.NET
    > > Please reply to the newsgroup. This email account is my spam trap so I
    > > don't check it very often. If you must reply off-line, then remove the
    > > "NO SPAM"
    > >
    > >[/ref]
    >
    >[/ref]


    A Guest

Similar Threads

  1. this.Context.Server.MapPath
    By crazyhorse in forum ASP.NET Building Controls
    Replies: 4
    Last Post: June 10th, 03:30 PM
  2. using Server.MapPath
    By Kian Goh in forum ASP.NET General
    Replies: 6
    Last Post: June 22nd, 01:16 PM
  3. Accessing Server.Mappath from SoapExtension
    By PA in forum ASP.NET Web Services
    Replies: 1
    Last Post: May 19th, 02:11 PM
  4. Replies: 2
    Last Post: February 5th, 03:19 PM
  5. Server MapPath
    By Henrique Berenguel in forum ASP.NET General
    Replies: 0
    Last Post: June 24th, 07:14 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139