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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two errors in 4 lines

Status
Not open for further replies.

mrkyn

MIS
Jan 30, 2002
78
0
0
US
I need your help to correct my errors. Here is my code

image_diplay = Session("Path")
If image_diplay="" Then
image_diplay = rsItem("ImageName")
Else
<script language=&quot;JavaScript&quot;>
location.reload()
</script>
End If


I have two errors.
1. &quot;Type mismatch&quot; on line image_diplay = rsItem(&quot;ImageName&quot;).
2. Expected statement, line 81 <script language=&quot;JavaScript&quot;>
 
Well part 2 is pretty easy.

<script language=&quot;JavaScript&quot;>
location.reload()
</script>

That's client side script that can't be contained between your <% %> tags.

I'd fix that part first and then see what happens.
 
The Type Mismatch error may be caused if you have a Null value in your recordset. Add an empty string to the end of that value so that if the rsItem(&quot;ImageName&quot;) is Null then it will put an empty string &quot;&quot; into the variable image_display.


image_diplay = rsItem(&quot;ImageName&quot;) & &quot;&quot;
 
Thanks for your help. It looks that taking the javascript part out of <% %> helped, but image_diplay = rsItem(&quot;ImageName&quot;) & &quot;&quot; did not help. I even added image_diplay = &quot;&quot; in the beginning. Still I am getting &quot;Type mismatch&quot; on line image_diplay = rsItem(&quot;ImageName&quot;).
 
Try this and see what you get:
<%
image_diplay = Session(&quot;Path&quot;)
response.write(&quot;Value of Session Var: &quot; & image_diplay & &quot;<br>&quot;)
If image_diplay=&quot;&quot; Then
'image_diplay = rsItem(&quot;ImageName&quot;)
response.write(&quot;The Recordset Value: &quot; & rsItem(&quot;ImageName&quot;) & &quot;<br>&quot;)
End if
response.end()
%>
I'm also wondering about image_diplay. Is this a misspelling or is that what you intended? Is it possible that you have it as image_display somewhere else in your code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top