Connecting Tech Pros Worldwide Forums | Help | Site Map

baffling 'file not found' error. I dare someone to solve this!

TimS
Guest
 
Posts: n/a
#1: Jul 19 '05
I am getting a baffling File not found error (0x800A0035).

I am writing asp on a windows 2000 server. I build a path and filename from
several fields in a jet database using SQL commands, like this:

Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
RS.open Sql
RS.movefirst
do while not RS.EOF
temp1=trim(RS("rootname"))
temp2=trim(RS("dirname"))
path1=Server.MapPath(temp1 & "\" & temp2) & "\pics.ini"

When I try to open the file I get this file not found error (0x800A0035).
However, if explicitly specify the path and filename (as in path2 below)
then it works. If I use path1 then it does not work. path2 was taken by
printing path1 to the browser window and then cutandpaste into my code.

Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
RS.open Sql
RS.movefirst
do while not RS.EOF
temp1=trim(RS("rootname"))
temp2=trim(RS("dirname"))
path1=Server.MapPath(temp1 & "\" & temp2 & "\pics.ini")
path2="C:\Inetpub\wwwroot\Tim & Janies Family Web Page\2003\pics.ini
' at this point path1=path2, this can be tested and proven
set fs=Server.CreateObject("Scripting.FileSystemObject ")
set f=fs.OpenTextFile(path2,1)

Why does the path/filename string built using the database not work but an
apparently IDENTICAL string which is explicitly typed in DOES work? I am
certain that this data is correct and it is not just a problem of me doing
something stupid.

Help?

TimS




Steven Burn
Guest
 
Posts: n/a
#2: Jul 19 '05

re: baffling 'file not found' error. I dare someone to solve this!


Surely it should be.........

path1=Server.MapPath(temp1 & "\" & temp2 & "\pics.ini")

--
Regards

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

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


TimS <tim.stoner@comcast.net> wrote in message
news:ekl2bT1yDHA.2156@TK2MSFTNGP09.phx.gbl...[color=blue]
> I am getting a baffling File not found error (0x800A0035).
>
> I am writing asp on a windows 2000 server. I build a path and filename[/color]
from[color=blue]
> several fields in a jet database using SQL commands, like this:
>
> Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
> RS.open Sql
> RS.movefirst
> do while not RS.EOF
> temp1=trim(RS("rootname"))
> temp2=trim(RS("dirname"))
> path1=Server.MapPath(temp1 & "\" & temp2) & "\pics.ini"
>
> When I try to open the file I get this file not found error (0x800A0035).
> However, if explicitly specify the path and filename (as in path2 below)
> then it works. If I use path1 then it does not work. path2 was taken by
> printing path1 to the browser window and then cutandpaste into my code.
>
> Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
> RS.open Sql
> RS.movefirst
> do while not RS.EOF
> temp1=trim(RS("rootname"))
> temp2=trim(RS("dirname"))
> path1=Server.MapPath(temp1 & "\" & temp2 & "\pics.ini")
> path2="C:\Inetpub\wwwroot\Tim & Janies Family Web Page\2003\pics.ini
> ' at this point path1=path2, this can be tested and proven
> set fs=Server.CreateObject("Scripting.FileSystemObject ")
> set f=fs.OpenTextFile(path2,1)
>
> Why does the path/filename string built using the database not work but an
> apparently IDENTICAL string which is explicitly typed in DOES work? I am
> certain that this data is correct and it is not just a problem of me doing
> something stupid.
>
> Help?
>
> TimS
>
>
>[/color]


TimS
Guest
 
Posts: n/a
#3: Jul 19 '05

re: baffling 'file not found' error. I dare someone to solve this!


Steven,

Re: your comment - the resulting path/filename variable is the same whether
the filename is inside or outside of the MapPath function.

This is a problem which is not going to resolve from a syntax correction.
All the relevent factors are contained in this paragraph. Basically, you
have two variables, path1 and path2. If you test them, path1=path2 is TRUE.
path1 was created using the code illustrated below. path2 was created by
printing path1 to the screen and then cut/pasting the path/filename string
into my code. path1 and path2 appear to be identical. However, path1 gives
a file not found error and path2 works, as shown in the code below.

If you don't already know the answer, I wager you will not be able to figure
it out. I am hoping someone already knows the answer :-) ....please!

TimS

"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:eW3NCW1yDHA.1996@TK2MSFTNGP12.phx.gbl...[color=blue]
> Surely it should be.........
>
> path1=Server.MapPath(temp1 & "\" & temp2 & "\pics.ini")
>
> --
> Regards
>
> Steven Burn
> Ur I.T. Mate Group
> www.it-mate.co.uk
>
> Keeping it FREE!
>
> Disclaimer:
> I know I'm probably wrong, I just like taking part ;o)
>
>
> TimS <tim.stoner@comcast.net> wrote in message
> news:ekl2bT1yDHA.2156@TK2MSFTNGP09.phx.gbl...[color=green]
> > I am getting a baffling File not found error (0x800A0035).
> >
> > I am writing asp on a windows 2000 server. I build a path and filename[/color]
> from[color=green]
> > several fields in a jet database using SQL commands, like this:
> >
> > Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
> > RS.open Sql
> > RS.movefirst
> > do while not RS.EOF
> > temp1=trim(RS("rootname"))
> > temp2=trim(RS("dirname"))
> > path1=Server.MapPath(temp1 & "\" & temp2) & "\pics.ini"
> >
> > When I try to open the file I get this file not found error[/color][/color]
(0x800A0035).[color=blue][color=green]
> > However, if explicitly specify the path and filename (as in path2 below)
> > then it works. If I use path1 then it does not work. path2 was taken[/color][/color]
by[color=blue][color=green]
> > printing path1 to the browser window and then cutandpaste into my code.
> >
> > Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
> > RS.open Sql
> > RS.movefirst
> > do while not RS.EOF
> > temp1=trim(RS("rootname"))
> > temp2=trim(RS("dirname"))
> > path1=Server.MapPath(temp1 & "\" & temp2 & "\pics.ini")
> > path2="C:\Inetpub\wwwroot\Tim & Janies Family Web Page\2003\pics.ini
> > ' at this point path1=path2, this can be tested and proven
> > set fs=Server.CreateObject("Scripting.FileSystemObject ")
> > set f=fs.OpenTextFile(path2,1)
> >
> > Why does the path/filename string built using the database not work but[/color][/color]
an[color=blue][color=green]
> > apparently IDENTICAL string which is explicitly typed in DOES work? I am
> > certain that this data is correct and it is not just a problem of me[/color][/color]
doing[color=blue][color=green]
> > something stupid.
> >
> > Help?
> >
> > TimS
> >
> >
> >[/color]
>
>[/color]


Steven Burn
Guest
 
Posts: n/a
#4: Jul 19 '05

re: baffling 'file not found' error. I dare someone to solve this!


Why don't you just do a Response.Write on the path thats not working and see
what it actually contains?

--
Regards

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

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


TimS <tim.stoner@comcast.net> wrote in message
news:O4KRVq1yDHA.1688@TK2MSFTNGP10.phx.gbl...[color=blue]
> Steven,
>
> Re: your comment - the resulting path/filename variable is the same[/color]
whether[color=blue]
> the filename is inside or outside of the MapPath function.
>
> This is a problem which is not going to resolve from a syntax correction.
> All the relevent factors are contained in this paragraph. Basically, you
> have two variables, path1 and path2. If you test them, path1=path2 is[/color]
TRUE.[color=blue]
> path1 was created using the code illustrated below. path2 was created by
> printing path1 to the screen and then cut/pasting the path/filename string
> into my code. path1 and path2 appear to be identical. However, path1[/color]
gives[color=blue]
> a file not found error and path2 works, as shown in the code below.
>
> If you don't already know the answer, I wager you will not be able to[/color]
figure[color=blue]
> it out. I am hoping someone already knows the answer :-) ....please!
>
> TimS
>
> "Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
> news:eW3NCW1yDHA.1996@TK2MSFTNGP12.phx.gbl...[color=green]
> > Surely it should be.........
> >
> > path1=Server.MapPath(temp1 & "\" & temp2 & "\pics.ini")
> >
> > --
> > Regards
> >
> > Steven Burn
> > Ur I.T. Mate Group
> > www.it-mate.co.uk
> >
> > Keeping it FREE!
> >
> > Disclaimer:
> > I know I'm probably wrong, I just like taking part ;o)
> >
> >
> > TimS <tim.stoner@comcast.net> wrote in message
> > news:ekl2bT1yDHA.2156@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > I am getting a baffling File not found error (0x800A0035).
> > >
> > > I am writing asp on a windows 2000 server. I build a path and filename[/color]
> > from[color=darkred]
> > > several fields in a jet database using SQL commands, like this:
> > >
> > > Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
> > > RS.open Sql
> > > RS.movefirst
> > > do while not RS.EOF
> > > temp1=trim(RS("rootname"))
> > > temp2=trim(RS("dirname"))
> > > path1=Server.MapPath(temp1 & "\" & temp2) & "\pics.ini"
> > >
> > > When I try to open the file I get this file not found error[/color][/color]
> (0x800A0035).[color=green][color=darkred]
> > > However, if explicitly specify the path and filename (as in path2[/color][/color][/color]
below)[color=blue][color=green][color=darkred]
> > > then it works. If I use path1 then it does not work. path2 was taken[/color][/color]
> by[color=green][color=darkred]
> > > printing path1 to the browser window and then cutandpaste into my[/color][/color][/color]
code.[color=blue][color=green][color=darkred]
> > >
> > > Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
> > > RS.open Sql
> > > RS.movefirst
> > > do while not RS.EOF
> > > temp1=trim(RS("rootname"))
> > > temp2=trim(RS("dirname"))
> > > path1=Server.MapPath(temp1 & "\" & temp2 & "\pics.ini")
> > > path2="C:\Inetpub\wwwroot\Tim & Janies Family Web Page\2003\pics.ini
> > > ' at this point path1=path2, this can be tested and proven
> > > set fs=Server.CreateObject("Scripting.FileSystemObject ")
> > > set f=fs.OpenTextFile(path2,1)
> > >
> > > Why does the path/filename string built using the database not work[/color][/color][/color]
but[color=blue]
> an[color=green][color=darkred]
> > > apparently IDENTICAL string which is explicitly typed in DOES work? I[/color][/color][/color]
am[color=blue][color=green][color=darkred]
> > > certain that this data is correct and it is not just a problem of me[/color][/color]
> doing[color=green][color=darkred]
> > > something stupid.
> > >
> > > Help?
> > >
> > > TimS
> > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Bob Barrows
Guest
 
Posts: n/a
#5: Jul 19 '05

re: baffling 'file not found' error. I dare someone to solve this!


TimS wrote:[color=blue]
> I am getting a baffling File not found error (0x800A0035).
>
> I am writing asp on a windows 2000 server. I build a path and
> filename from several fields in a jet database using SQL commands,
> like this:
>
> Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
> RS.open Sql
> RS.movefirst
> do while not RS.EOF
> temp1=trim(RS("rootname"))
> temp2=trim(RS("dirname"))
> path1=Server.MapPath(temp1 & "\" & temp2) & "\pics.ini"
>
> When I try to open the file I get this file not found error
> (0x800A0035). However, if explicitly specify the path and filename
> (as in path2 below) then it works. If I use path1 then it does not
> work. path2 was taken by printing path1 to the browser window and
> then cutandpaste into my code.
>
> Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
> RS.open Sql
> RS.movefirst
> do while not RS.EOF
> temp1=trim(RS("rootname"))
> temp2=trim(RS("dirname"))
> path1=Server.MapPath(temp1 & "\" & temp2 & "\pics.ini")
> path2="C:\Inetpub\wwwroot\Tim & Janies Family Web Page\2003\pics.ini
> ' at this point path1=path2, this can be tested and proven[/color]

How?
[color=blue]
> set fs=Server.CreateObject("Scripting.FileSystemObject ")
> set f=fs.OpenTextFile(path2,1)
>
> Why does the path/filename string built using the database not work
> but an apparently IDENTICAL string which is explicitly typed in DOES
> work?[/color]

Have you done a
Response.Write path1 & "<BR>" & path2
to make sure that they are identical?

--
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"


Jeff Cochran
Guest
 
Posts: n/a
#6: Jul 19 '05

re: baffling 'file not found' error. I dare someone to solve this!


On Thu, 25 Dec 2003 18:06:17 -0800, "TimS" <tim.stoner@comcast.net>
wrote:
[color=blue]
>I am getting a baffling File not found error (0x800A0035).
>
>I am writing asp on a windows 2000 server. I build a path and filename from
>several fields in a jet database using SQL commands, like this:
>
>Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
>RS.open Sql
>RS.movefirst
>do while not RS.EOF
>temp1=trim(RS("rootname"))
>temp2=trim(RS("dirname"))
>path1=Server.MapPath(temp1 & "\" & temp2) & "\pics.ini"
>
>When I try to open the file I get this file not found error (0x800A0035).
>However, if explicitly specify the path and filename (as in path2 below)
>then it works. If I use path1 then it does not work. path2 was taken by
>printing path1 to the browser window and then cutandpaste into my code.
>
>Sql = "SELECT dirs.rootname,dirs.dirname FROM dirs"
>RS.open Sql
>RS.movefirst
>do while not RS.EOF
>temp1=trim(RS("rootname"))
>temp2=trim(RS("dirname"))
>path1=Server.MapPath(temp1 & "\" & temp2 & "\pics.ini")
>path2="C:\Inetpub\wwwroot\Tim & Janies Family Web Page\2003\pics.ini
>' at this point path1=path2, this can be tested and proven
>set fs=Server.CreateObject("Scripting.FileSystemObject ")
>set f=fs.OpenTextFile(path2,1)
>
>Why does the path/filename string built using the database not work but an
>apparently IDENTICAL string which is explicitly typed in DOES work? I am
>certain that this data is correct and it is not just a problem of me doing
>something stupid.[/color]

We're not that certain, you'll have to prove it. Post a
Response.Write of Path1...

Jeff
Closed Thread


Similar ASP / Active Server Pages bytes