Re: ASP Database connection problem

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 04/29/04


Date: Thu, 29 Apr 2004 09:19:49 -0400

Chris Barber wrote:
> Dear gawd - I'd better go off and put the Dunces cap on - I even read
> all the posts and tried to not do that!
>
> Although - doesn't really matter in ASP VBScript does it - only
> Javascript cares about it since VBScript has no '\' escape character?
>
Hmm, I guess you're right. I could have sworn I received an error when using
backslashes in the past, but I've just tested it with this:

Response.Write server.MapPath("w2kmigration.mdb") & "<BR>"
Response.Write server.MapPath("..\test_Local\w2kmigration.mdb") & "<BR>"
Response.Write server.MapPath("../test_Local/w2kmigration.mdb") & "<BR>"

and got this result:
C:\Visual Studio Projects\test\test_Local\w2kmigration.mdb
C:\Visual Studio Projects\test\test_Local\w2kmigration.mdb
C:\Visual Studio Projects\test\test_Local\w2kmigration.mdb

In fact, this even worked (watch for line break - should be single line):
Response.Write server.MapPath(".\Visual Studio
Projects\test\test_Local\w2kmigration.mdb")

It isn't until I try to use the C: that I get the message I remember
getting:
Error Type:
Server.MapPath(), ASP 0172 (0x80004005)
The Path parameter for the MapPath method must be a virtual path. A physical
path was used.

I was thinking it used the slash-type to determine when a physical path was
being supplied. Learn something new every day ...

Bob

-- 
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Relevant Pages

  • Re: ASP Database connection problem
    ... C:\Visual Studio Projects\test\test_Local\w2kmigration.mdb ... Error Type: ... I was thinking it used the slash-type to determine when a physical path was ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.general)
  • RE: Confusion about .NET Development for Smartphone 2003
    ... Welcome to the ASP.NET mobile newsgroup. ... so if you're using the Visual Studio 2005 ... team suite, you can just create the certain smart device project and build ...
    (microsoft.public.dotnet.framework.aspnet.mobile)
  • Re: Chrome - competition for Borland?
    ... an Object Pascal dialect that fits inside Visual ... > Studio. ... > to be a threat to Borland Delphi for dotnet? ... newsgroup of Chrome's makers. ...
    (borland.public.delphi.non-technical)
  • Re: how to make system independent exe. file in C#
    ... >studio .Net installed on them ... Users don't need VS.NET, but the .NET Framework must be installed, ... Mattias Sjögren [MVP] mattias @ mvps.org ... Please reply only to the newsgroup. ...
    (microsoft.public.dotnet.framework)