Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

makes no sense: object required " 1

Status
Not open for further replies.

browolf

Programmer
Dec 18, 2001
442
GB
i've got these lines in some code:

response.write f1.name
flink = "/subjects/" & whichpage & "/files/" & fl.name


which i use a few lines down in a custom generated href

trouble is i'm getting the output:

testfile.txt
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/header.asp, line 14


line 14 is the "flink =" line
if i remove "& fl.name" there's no error but the href is wrong then.

am i going mad/missing something simple? ===============
Security Forums
 
I doesn't appear that the flink variable is a string. Try,

flink = chr(34) & "/subjects/" & whichpage & "/files/" & fl.name & chr(34)
________________________________________________________________________
Are you trying to debug your ASP applications? See faq333-3255 for more details

regards,
Brian
 
that's a thought. but it didnt seem to fix it.
but now when i do


12. response.write f1.name & " " & whichpage
13. flink = "/subjects/" & whichpage & /files/"
14. '& fl.name
15. response.write = &quot;<a href=&quot; & hr(34) & flink & chr(34) & &quot;>&quot; & filename & &quot;</a><br>&quot;


i get
testfile.txt Business
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'write'
/header.asp, line 15

since when does response not support write ???
oh ffs....
===============
Security Forums
 
didn't you forget a &quot; char here :
Code:
response.write f1.name & &quot; &quot; & whichpage
flink = &quot;/subjects/&quot; & whichpage &
&quot;
Code:
/files/&quot;
'& fl.name
response.write =  &quot;<a href=&quot; & hr(34) & flink  & chr(34) & &quot;>&quot; & filename & &quot;</a><br>&quot;
Water is not bad as long as it stays out human body ;-)
 
The object f1 is what is required. Are you declaring that object before trying to use it?

-Bad Dos
 
sorry targot i had to unwrap the text when i pasted it. must have lost a &quot;
i'll paste it as it is and not mess with it

code is:
for each f1 in fc
filestuff = split(f1.name,&quot;.&quot;)
filename= lcase(filestuff(0))
response.write f1.name & &quot; &quot; & whichpage
flink = &quot;/subjects/&quot; & whichpage & &quot;/files/&quot; & fl.name
response.write = &quot;<a href=&quot; & chr(34) & flink & chr(34) & &quot;>&quot; & filename & &quot;</a><br>&quot;
next

error is:
Files for Business Studies:
testfile.txt Business

Microsoft VBScript runtime error '800a01a8'

Object required: ''

/header.asp, line 13

hmm it's shows up here as '' not &quot;
===============
Security Forums
 
It looks like you have used f1 (F one) for the first line and then FL on the line that is throwing the error. --James
 
use something less confusing like theFile

for each theFile in fc
filestuff = split(theFile.name,&quot;.&quot;)
filename= lcase(filestuff(0))
response.write theFile.name & &quot; &quot; & whichpage
flink = &quot;/subjects/&quot; & whichpage & &quot;/files/&quot; & theFile.name
response.write &quot;<a href=&quot; & chr(34) & flink & chr(34) & &quot;>&quot; & filename & &quot;</a><br>&quot;


next


________________________________________________________________________
Are you trying to debug your ASP applications? See faq333-3255 for more details

regards,
Brian
 
Another thing browolf. To avoid loosing hours and hours, Take that good habit of &quot;Option Explicit&quot; and &quot;Dim&quot;. In this particular case, you would have found your error in a quater of seconds as you should have been told at runtime &quot;variable fl has not been defined.&quot;.
VB (and all its brother languages VBA, VBS, ASP) is the only language I know where variable defining is not needed. It's a great error cause. So, take the reflex of the &quot;Option explicit&quot; that forces you to define your variables by a &quot;Dim&quot;. Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top