Ask a Question related to ASP Components, Design and Development.
-
mallyonline #1
Expected end of statement
Hi all,
This will be my 1st post on here!
i am trying to view a list of files within a folder on my server drive using
this bit of code.
<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject ")
set fo=fs.GetFolder("C:\Documents and Settings\local.myserever\Desktop\Share
folder\")for each x in fo.files
'Print the name of all files in the test folder
Response.write(x.Name & "<br />")
nextset fo=nothing
set fs=nothing
%>Output:
however all i am getting is
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/asptestpage.asp, line 11
this is the offending line "set fo=fs.GetFolder("C:\Documents and
Settings\local.myserever\Desktop\Share folder\")for each x in fo.files"
i know that comments should have an apostrophe at the end and noticed that
this code has it at the start however wheni tried to change it it never made
any difference?
any ideas
cheers
malcolm
mallyonline Guest
-
The DREADED Expected end of statement
Microsoft VBScript compilation error '800a0401' Can someone please look at my code and tell me what the deal is? I am stumped. Expected end of... -
Expected end of statement
Try this instead provider=Microsoft.Jet.oledb.4.0;Data Source=c:\testapp\asp_test.mdb; User ID=('admin'); Password=("") -
Expected end of statement
Can you post the EXACT error you're getting? -
800A0401: Expected End of Statement
I am trying to get this code going but always the following error message: Error Type: Microsoft VBScript compilation (0x800A0401) Expected end... -
Expected end of statement problem
Having a nightmare problem with this and would appreciate any and all help. The situation is I want to move from a webform and format the user... -
Steven Burn #2
Re: Expected end of statement
Change it to (changed your naming convention a little too);
<%
Dim objFSO,objFldr,objFl, sPath
sPath = "C:\Documents and Settings\local.myserever\Desktop\Share folder\"
Set objFSO=Server.CreateObject("Scripting.FileSystemOb ject")
Set objFldr=objFSO.GetFolder(sPath)
For Each objFl in objFldr.Files
'Print the name of all files in the test folder
Response.Write objFl.Name & "<br />"
Next
Set objFldr=Nothing
Set objFSO=Nothing
%>
--
Regards
Steven Burn
Ur I.T. Mate Group
[url]www.it-mate.co.uk[/url]
Keeping it FREE!
"mallyonline" <malcolmkwhyte@btinternet.com> wrote in message news:d7fke7$6bl$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...> Hi all,
> This will be my 1st post on here!
> i am trying to view a list of files within a folder on my server drive using
> this bit of code.
>
> <%
> dim fs,fo,x
> set fs=Server.CreateObject("Scripting.FileSystemObject ")
> set fo=fs.GetFolder("C:\Documents and Settings\local.myserever\Desktop\Share
> folder\")for each x in fo.files
> 'Print the name of all files in the test folder
> Response.write(x.Name & "<br />")
> nextset fo=nothing
> set fs=nothing
> %>Output:
>
> however all i am getting is
> Microsoft VBScript compilation error '800a0401'
> Expected end of statement
> /asptestpage.asp, line 11
> this is the offending line "set fo=fs.GetFolder("C:\Documents and
> Settings\local.myserever\Desktop\Share folder\")for each x in fo.files"
>
> i know that comments should have an apostrophe at the end and noticed that
> this code has it at the start however wheni tried to change it it never made
> any difference?
> any ideas
> cheers
> malcolm
>
>Steven Burn Guest
-
mallyonline #3
Re: Expected end of statement
Brilliant, fantastic, it worked a treat
thank you
have you any idea how to make the link clickable
"Steven Burn" <somewhere@in-time.invalid> wrote in message
news:OuzX$XUZFHA.2984@TK2MSFTNGP15.phx.gbl...
Change it to (changed your naming convention a little too);
<%
Dim objFSO,objFldr,objFl, sPath
sPath = "C:\Documents and Settings\local.myserever\Desktop\Share folder\"
Set objFSO=Server.CreateObject("Scripting.FileSystemOb ject")
Set objFldr=objFSO.GetFolder(sPath)
For Each objFl in objFldr.Files
'Print the name of all files in the test folder
Response.Write objFl.Name & "<br />"
Next
Set objFldr=Nothing
Set objFSO=Nothing
%>
--
Regards
Steven Burn
Ur I.T. Mate Group
[url]www.it-mate.co.uk[/url]
Keeping it FREE!
"mallyonline" <malcolmkwhyte@btinternet.com> wrote in message
news:d7fke7$6bl$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...> Hi all,
> This will be my 1st post on here!
> i am trying to view a list of files within a folder on my server drive
> using
> this bit of code.
>
> <%
> dim fs,fo,x
> set fs=Server.CreateObject("Scripting.FileSystemObject ")
> set fo=fs.GetFolder("C:\Documents and
> Settings\local.myserever\Desktop\Share
> folder\")for each x in fo.files
> 'Print the name of all files in the test folder
> Response.write(x.Name & "<br />")
> nextset fo=nothing
> set fs=nothing
> %>Output:
>
> however all i am getting is
> Microsoft VBScript compilation error '800a0401'
> Expected end of statement
> /asptestpage.asp, line 11
> this is the offending line "set fo=fs.GetFolder("C:\Documents and
> Settings\local.myserever\Desktop\Share folder\")for each x in fo.files"
>
> i know that comments should have an apostrophe at the end and noticed that
> this code has it at the start however wheni tried to change it it never
> made
> any difference?
> any ideas
> cheers
> malcolm
>
>
mallyonline Guest
-
Steven Burn #4
Re: Expected end of statement
Your welcome ;o)
As for making it clickable, change;
Response.Write objFl.Name & "<br />"
To;
Response.Write "<a href=""objFl.Name"" target=""_blank"">" & objFl.Name & "</a><br />"
NB: Using objFl.Name in the href parameter assumes the file is in the same folder as your script. If not, change objFl.Name to objFl.Path
--
Regards
Steven Burn
Ur I.T. Mate Group
[url]www.it-mate.co.uk[/url]
Keeping it FREE!
"mallyonline" <malcolmkwhyte@btinternet.com> wrote in message news:d7fo52$8d7$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...> Brilliant, fantastic, it worked a treat
> thank you
>
> have you any idea how to make the link clickable
>
> "Steven Burn" <somewhere@in-time.invalid> wrote in message
> news:OuzX$XUZFHA.2984@TK2MSFTNGP15.phx.gbl...
> Change it to (changed your naming convention a little too);
>
> <%
> Dim objFSO,objFldr,objFl, sPath
> sPath = "C:\Documents and Settings\local.myserever\Desktop\Share folder\"
> Set objFSO=Server.CreateObject("Scripting.FileSystemOb ject")
> Set objFldr=objFSO.GetFolder(sPath)
> For Each objFl in objFldr.Files
> 'Print the name of all files in the test folder
> Response.Write objFl.Name & "<br />"
> Next
> Set objFldr=Nothing
> Set objFSO=Nothing
>
> %>
>
> --
> Regards
>
> Steven Burn
> Ur I.T. Mate Group
> [url]www.it-mate.co.uk[/url]
>
> Keeping it FREE!
>
> "mallyonline" <malcolmkwhyte@btinternet.com> wrote in message
> news:d7fke7$6bl$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...>> > Hi all,
> > This will be my 1st post on here!
> > i am trying to view a list of files within a folder on my server drive
> > using
> > this bit of code.
> >
> > <%
> > dim fs,fo,x
> > set fs=Server.CreateObject("Scripting.FileSystemObject ")
> > set fo=fs.GetFolder("C:\Documents and
> > Settings\local.myserever\Desktop\Share
> > folder\")for each x in fo.files
> > 'Print the name of all files in the test folder
> > Response.write(x.Name & "<br />")
> > nextset fo=nothing
> > set fs=nothing
> > %>Output:
> >
> > however all i am getting is
> > Microsoft VBScript compilation error '800a0401'
> > Expected end of statement
> > /asptestpage.asp, line 11
> > this is the offending line "set fo=fs.GetFolder("C:\Documents and
> > Settings\local.myserever\Desktop\Share folder\")for each x in fo.files"
> >
> > i know that comments should have an apostrophe at the end and noticed that
> > this code has it at the start however wheni tried to change it it never
> > made
> > any difference?
> > any ideas
> > cheers
> > malcolm
> >
> >
>Steven Burn Guest
-
mallyonline #5
Re: Expected end of statement
This is absolute dynamite
Thank you
But apart from making it clickable! how can i make it download a file from
that folder :)
all that happens when i click is the standard 404 error message.....
cheers
malcolm
"Steven Burn" <somewhere@in-time.invalid> wrote in message
news:O7QBo7UZFHA.2400@TK2MSFTNGP10.phx.gbl...
Your welcome ;o)
As for making it clickable, change;
Response.Write objFl.Name & "<br />"
To;
Response.Write "<a href=""objFl.Name"" target=""_blank"">" & objFl.Name
& "</a><br />"
NB: Using objFl.Name in the href parameter assumes the file is in the same
folder as your script. If not, change objFl.Name to objFl.Path
--
Regards
Steven Burn
Ur I.T. Mate Group
[url]www.it-mate.co.uk[/url]
Keeping it FREE!
"mallyonline" <malcolmkwhyte@btinternet.com> wrote in message
news:d7fo52$8d7$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...> Brilliant, fantastic, it worked a treat
> thank you
>
> have you any idea how to make the link clickable
>
> "Steven Burn" <somewhere@in-time.invalid> wrote in message
> news:OuzX$XUZFHA.2984@TK2MSFTNGP15.phx.gbl...
> Change it to (changed your naming convention a little too);
>
> <%
> Dim objFSO,objFldr,objFl, sPath
> sPath = "C:\Documents and Settings\local.myserever\Desktop\Share folder\"
> Set objFSO=Server.CreateObject("Scripting.FileSystemOb ject")
> Set objFldr=objFSO.GetFolder(sPath)
> For Each objFl in objFldr.Files
> 'Print the name of all files in the test folder
> Response.Write objFl.Name & "<br />"
> Next
> Set objFldr=Nothing
> Set objFSO=Nothing
>
> %>
>
> --
> Regards
>
> Steven Burn
> Ur I.T. Mate Group
> [url]www.it-mate.co.uk[/url]
>
> Keeping it FREE!
>
> "mallyonline" <malcolmkwhyte@btinternet.com> wrote in message
> news:d7fke7$6bl$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...>> > Hi all,
> > This will be my 1st post on here!
> > i am trying to view a list of files within a folder on my server drive
> > using
> > this bit of code.
> >
> > <%
> > dim fs,fo,x
> > set fs=Server.CreateObject("Scripting.FileSystemObject ")
> > set fo=fs.GetFolder("C:\Documents and
> > Settings\local.myserever\Desktop\Share
> > folder\")for each x in fo.files
> > 'Print the name of all files in the test folder
> > Response.write(x.Name & "<br />")
> > nextset fo=nothing
> > set fs=nothing
> > %>Output:
> >
> > however all i am getting is
> > Microsoft VBScript compilation error '800a0401'
> > Expected end of statement
> > /asptestpage.asp, line 11
> > this is the offending line "set fo=fs.GetFolder("C:\Documents and
> > Settings\local.myserever\Desktop\Share folder\")for each x in fo.files"
> >
> > i know that comments should have an apostrophe at the end and noticed
> > that
> > this code has it at the start however wheni tried to change it it never
> > made
> > any difference?
> > any ideas
> > cheers
> > malcolm
> >
> >
>
mallyonline Guest



Reply With Quote

