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

Ubound error in page

Status
Not open for further replies.

btween

Programmer
Joined
Aug 7, 2003
Messages
338
Location
US
I am having some issue with this page.

Basically on the previous page a lawyer area and lawyer law type is selected and this page is supposed to return all matching records. When there are no records matching, the page is supposed to return some html (in red.) Instead I get this error:

Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'Ubound'
/infotest.asp, line 224

I tried to do a redirect before getting to that function (in red) but the client wants the page to display with the text. Does anyone know what can be done to fix this.

Thanks for your suggestions:



<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = &quot;no-cache&quot;
%>
<!--ASP codes developed by Shafi Kashefi (shafi@vancouvermart.com)Dec 2002. All rights reserved-->
<!--#include file=&quot;law.inc&quot;-->
<%
Set law_Conn = Server.CreateObject(&quot;adodb.Connection&quot;)
Set lawRS = Server.CreateObject(&quot;adodb.RecordSet&quot;)
Set insRS = Server.CreateObject(&quot;adodb.RecordSet&quot;)
Set tmpRS = Server.CreateObject(&quot;adodb.RecordSet&quot;)
Set fso = Server.CreateObject(&quot;scripting.FileSystemObject&quot;)
law_Conn.Open Session(&quot;law_DSN&quot;)

if inStr(1,Request.ServerVariables(&quot;HTTP_USER_AGENT&quot;),&quot;msie&quot;,1)>0 then
isIE = true
else
isIE = false
end if

lawType = request(&quot;lawType&quot;)
region = request(&quot;region&quot;)
action = request(&quot;action&quot;)
lawyerID_str = request(&quot;lawyerID_str&quot;)

tmpRS.Open &quot;Select [CapturedR],[ImageFile] From [tbl_Region] Where [Region] = '&quot;& CheckStringIn(region) &&quot;' &quot;,law_Conn, adOpenDynamic
if not (tmpRS.EOF AND tmpRS.BOF) then
regionImgFile = CheckStringOut(tmpRS(&quot;ImageFile&quot;))
txtFile_Region = CheckStringOut(tmpRS(&quot;CapturedR&quot;))
else
regionImgFile = &quot;&quot;
end if
tmpRS.Close

tmpRS.Open &quot;Select [CapturedLT],[ImageFile] From [tbl_LawType] Where [LawType] = '&quot;& CheckStringIn(lawType) &&quot;' &quot;,law_Conn, adOpenDynamic
if not (tmpRS.EOF AND tmpRS.BOF) then
lwTypeImgFile = CheckStringOut(tmpRS(&quot;ImageFile&quot;))
txtFile_LT = CheckStringOut(tmpRS(&quot;CapturedLT&quot;))
else
lwTypeImgFile = &quot;&quot;
end if
tmpRS.Close


lawRS.Open &quot;Select * From [tbl_Lawyers] Where (([Region] = '&quot;& region &&quot;') AND ([LawType] = '&quot;& lawType &&quot;') AND ([Active] = true) AND ([ExclusiveListing] = true))&quot;, law_Conn, 3, 1
if not (lawRS.EOF AND lawRS.BOF) then
lawyerExists = true
lawyerID_str =&quot;,&quot;
lawyerInfo_str = &quot;|&quot;
while not lawRS.EOF
lawyerID_str = lawyerID_str & lawRS(&quot;ID&quot;) & &quot;,&quot;
lawyerInfo_str = lawyerInfo_str & lawRS(&quot;ID&quot;) &&quot;^&quot;& CheckStringOut(lawRS(&quot;FirstName&quot;)) &&quot; &quot;& CheckStringOut(lawRS(&quot;LastName&quot;)) &&quot;^&quot;& CheckStringOut(lawRS(&quot;Email&quot;)) &&quot;^&quot;& CheckStringOut(lawRS(&quot;ImageFile&quot;)) &&quot;^&quot;& CheckStringOut(lawRS(&quot;Description&quot;)) &&quot;^&quot;& CheckStringOut(lawRS(&quot;Web&quot;)) & &quot;^&quot; & CheckStringOut(lawRS(&quot;Company&quot;)) & &quot;|&quot;
lawRS.MoveNext
wend

if right(lawyerinfo_str,1) = &quot;|&quot; then lawyerinfo_str = left(lawyerinfo_str,len(lawyerinfo_str)-1)
lawyerInfo_ary = Split(lawyerInfo_str,&quot;|&quot;)
if isArray(lawyerInfo_ary) then
ub = Ubound(lawyerInfo_ary)
Redim theVal(ub)
Randomize
for k = 1 to ub
j = Int(((ubound(lawyerInfo_ary) - 1 + 1)* Rnd + 1))
theVal(k) = lawyerInfo_ary(j)
lawyerInfo_str = Replace(lawyerInfo_str,&quot;|&quot;&lawyerInfo_ary(j),&quot;&quot;)
lawyerInfo_ary = Split(lawyerInfo_str,&quot;|&quot;)
next
else
Redim theVal(1)
theVal(1) = lawyerInfo_str
end if
else
lawyerExists = false
end if
lawRS.Close

'if lawyerExists = false then Response.Redirect &quot;1index.asp&quot;

'SERVER-->
theFile_title = Server.MapPath(&quot;/txtFiles/&quot;) & &quot;\&quot; & txtFile_LT &&quot;_&quot;& txtFile_Region & &quot;_title.txt&quot;
'theFile_title = Server.MapPath(&quot;/lawyer/txtFiles/&quot;) & &quot;\&quot; & txtFile_LT &&quot;_&quot;& txtFile_Region & &quot;_title.txt&quot;
'SERVER-->
theFile_footer = Server.MapPath(&quot;/txtFiles/&quot;) & &quot;\&quot; & txtFile_LT &&quot;_&quot;& txtFile_Region & &quot;_footer.txt&quot;
'theFile_footer = Server.MapPath(&quot;/lawyer/txtFiles/&quot;) & &quot;\&quot; & txtFile_LT &&quot;_&quot;& txtFile_Region & &quot;_footer.txt&quot;

SELECT CASE Left(Lcase(action),4)
Case &quot;conn&quot;
selCon = request(&quot;selectedcontacts&quot;)

insRS.Open &quot;tbl_Cases&quot;, law_Conn, adOpenDynamic, adLockOptimistic
insRS.AddNew
insRS(&quot;Name&quot;) = CheckStringIn(request(&quot;name&quot;))
insRS(&quot;Email&quot;) = CheckStringIn(request(&quot;email&quot;))
insRS(&quot;Phone&quot;) = CheckStringIn(request(&quot;phone&quot;))
insRS(&quot;CaseDesc&quot;) = CheckStringIn(request(&quot;casedesc&quot;))
insRS(&quot;Region&quot;) = CheckStringIn(region)
insRS(&quot;Lawyer_ID&quot;) = CheckStringIn(selCon)
insRS(&quot;caseDate&quot;) = Date()
insRS.Update
insRS.MoveLast
caseID = insRS(&quot;ID&quot;)
insRS.Close

lawyerID_ary = split(selCon,&quot;,&quot;)
insRS.Open &quot;tbl_caseLog&quot;, law_Conn, adOpenDynamic, adLockOptimistic
for elm = 1 to Ubound(lawyerID_ary)-1
if Len(lawyerID_ary(elm))>0 then
insRS.AddNew
insRS(&quot;Case_ID&quot;) = caseID
insRS(&quot;Lawyer_ID&quot;) = lawyerID_ary(elm)
insRS(&quot;theDate&quot;) = Date()
insRS.Update
end if
next 'elm
insRS.Close

lnbr = Chr(13) & Chr(10)
CCsent = false
'Response.Write &quot;LawyerInfo: &quot;& lawyerInfo_str & &quot;<br>&quot;
lawyerInfo_ary = Split(lawyerInfo_str,&quot;|&quot;)
'Response.Write &quot;isArray: &quot; & isArray(lawyerInfo_ary) & &quot;<br>&quot;
for a= 0 to Ubound(lawyerInfo_ary)
if Len(lawyerInfo_ary(a))>0 then
arytmp = Split(lawyerInfo_ary(a),&quot;^&quot;)
'Response.Write &quot;Ary temp is array: &quot; & isArray(arytmp) & &quot;<br>&quot;
L_ID = Trim(arytmp(0))
if inStr(selCon,&quot;,&quot;&L_ID&&quot;,&quot;) > 0 then
L_Name = Trim(arytmp(1))
L_Email = Trim(arytmp(2))
'Response.Write &quot;L_ID: &quot; & L-ID & &quot;<br>&quot;
'Response.Write &quot;L_Name: &quot; & L_Name & &quot;<br>&quot;
'Response.Write &quot;L_Email: &quot; & L_Email & &quot;<br>&quot;

Set Mailer = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
msgFrom = &quot;Lawyer-Connect website&quot; & &quot;<mfw@michaelwilliamswebdesign.com>&quot;
msgTo = L-Name & &quot;<&quot; & L_Email & &quot;>&quot;
Mailer.From = msgfrom
Mailer.to = msgTo
if not CCsent then Mailer.CC = &quot;Michael Williams&quot; & &quot;<mfw@michaelwilliamswebdesign.com>&quot;
Mailer.Subject = &quot;Lawyer-Connect.com Inquiry&quot;

strMessage = &quot;&quot;
strMessage = &quot;Dear &quot; & L_Name & lnbr
strMessage = strMessage& &quot;You've just recieved an inquiry through Lawyer-Connect.com website. Below are the details of the inquiry: &quot; & lnbr & lnbr
StrMessage = strMessage& &quot;Client's name: &quot; & request(&quot;name&quot;) & lnbr
StrMessage = strMessage& &quot;Client's phone: &quot; & request(&quot;phone&quot;) & lnbr
StrMessage = strMessage& &quot;Client's email: &quot; & request(&quot;email&quot;) & lnbr
StrMessage = strMessage& &quot;Client's case: &quot; & request(&quot;casedesc&quot;) & lnbr
Mailer.Body = StrMessage
Mailer.Send
'Response.Write &quot;StrMessage: &quot; & strmessage & &quot;<br>&quot;
'Response.Write &quot;<hr>&quot;
Set objMailer = nothing
CCsent = true
StrMessage = &quot;&quot;
end if 'instr
end if 'Len(lawyerInfor_ary)
next 'a
%>
<script LANGUAGE=&quot;javascript&quot;>
<!--
alert(&quot;Your inquiry was sent to these lawyers. They will contact you shortly.&quot;);
parent.location.href = &quot;index.asp&quot;
//-->
</script>
<%
Response.End

END SELECT
%>
<html>
<head>
<%
if fso.FileExists(theFile_title) then
Set f = fso.OpenTextFile(theFile_title,1,true)
theTitle = f.ReadAll()
else
theTitle = &quot;&quot;
end if

%>
<title><%=theTitle%></title>
<meta HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html; charset=iso-8859-1&quot;>
<script LANGUAGE=&quot;JavaScript&quot;>
<!--
<!--

function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments].src = changeImages.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
button_about_over = newImage(&quot;images/button_about-over.gif&quot;);
preloadFlag = true;
}
}

function getDetails(lawID,region,lawyerID_str)
{
if (lawID.length == 0) return (false);
document.getElementById('lawDetails').src = &quot;detail.asp?lawID=&quot; + lawID + &quot;&region=&quot; + escape(region) + &quot;&lawyerID_str=&quot; + escape(lawyerID_str);
}

function getSelContacts(theForm)
{
var contactstr = &quot;,&quot;;
var selConAry = new Array()

if (<%=ubound(theval)%> > 1)


{
selConAry = theForm.selectedcontacts;
}else
{
selConAry[0] = theForm.selectedcontacts;
}

for (i=0;i<selConAry.length;i++)
{
if (selConAry.checked) contactstr += selConAry.value+&quot;,&quot;;
}
if (contactstr == &quot;,&quot;) contactstr = &quot;&quot;;

return (contactstr);
}
function regContacts(theForm)
{
document.getElementById('lawDetails').src = &quot;contact.asp?region=<%=Server.URLEncode(region)%>&lawtype=<%=Server.URLEncode(lawtype)%>&lawyerID_str=<%=Server.URLEncode(lawyerID_str)%>&selContacts=&quot;+escape(getSelContacts(theForm));

}

// -->
function doIt(v)
{
for(var i=0;i<document.lawyerListForm.selectedcontacts.length;i++)
document.lawyerListForm.selectedcontacts.checked=eval(v);
document.lawyerListForm.c3.checked=false;
document.lawyerListForm.c4.checked=false;
}

function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
<link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot;>
</head>
<body BGCOLOR=&quot;#CDCED6&quot; link=&quot;#006666&quot; vlink=&quot;#99CCCC&quot; alink=&quot;#59AC59&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; ONLOAD=&quot;preloadImages();regContacts(lawyerListForm);&quot;>
<form name=&quot;lawyerListForm&quot;>
<table WIDTH=&quot;800&quot; BORDER=&quot;0&quot; CELLPADDING=&quot;0&quot; CELLSPACING=&quot;0&quot;>
<tr>
<td>
<table WIDTH=&quot;800&quot; BORDER=&quot;0&quot; CELLPADDING=&quot;0&quot; CELLSPACING=&quot;0&quot;>
<tr>
<td> <a href=&quot;index.asp&quot;><img SRC=&quot;images/logo.jpg&quot; WIDTH=&quot;226&quot; HEIGHT=&quot;96&quot; border=&quot;0&quot;></a></td>
<td><a href=&quot;index.asp&quot;><img SRC=&quot;images/top.jpg&quot; WIDTH=&quot;574&quot; HEIGHT=&quot;96&quot; border=&quot;0&quot; alt=&quot;find a lawyer&quot;></a></td>
</tr>
<tr>
<td valign=&quot;top&quot; bgcolor=&quot;#FFFFFF&quot;><img SRC=&quot;images/logo02.jpg&quot; WIDTH=&quot;226&quot; HEIGHT=&quot;42&quot;></td>
<td background=&quot;images/bgimage-top.gif&quot; nowrap> <img src=&quot;images/spacer.gif&quot; width=&quot;1&quot; height=&quot;6&quot;><br>
<img src=&quot;images/<%=regionImgFile%>&quot;><img src=&quot;images/<%=lwTypeImgFile%>&quot;><img src=&quot;images/lawyer-directory.gif&quot; width=&quot;54&quot; height=&quot;30&quot;><br>
<img src=&quot;images/info.gif&quot; width=&quot;385&quot; height=&quot;52&quot; usemap=&quot;#Map&quot; border=&quot;0&quot; alt=&quot;top lawyer directory finding a lawyer&quot;></td>
</tr></table>
</td>
</tr>

<%
if not lawyerExists then

%>
<tr>
<td valign=&quot;top&quot; align=&quot;center&quot; bgcolor=&quot;#FFFFFF&quot;>
<p><br>
<br>
<br>
<b><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;>Sorry!</font></b><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;>
Currently there is not a lawyer in our database in this category/region.
<br>
<a href=&quot;index.asp&quot;>Please try another search</a></font>.</p>
<p><a href=&quot;registration.asp&quot;><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;>Add
your Law Firm to the Lawyer-Connect Directory.</font></a><br>
<br>
<br>
</p>
</td>
</tr>

<%
else
%>
<tr valign=&quot;top&quot;>
<td valign=&quot;top&quot; align=&quot;right&quot; background=&quot;images/bgimage-bottom.jpg&quot;><table width=&quot;95%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td valign=&quot;top&quot;>
<p align=&quot;left&quot;><img src=&quot;images/spacer.gif&quot; width=&quot;400&quot; height=&quot;8&quot; border=&quot;0&quot;><br>
<font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot; color=&quot;#3A6955&quot;>&nbsp;<font color=&quot;#003399&quot;>&nbsp;Roll
your mouse over the graphic </font></font><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot; color=&quot;#3A6955&quot;><font color=&quot;#003399&quot;>
below to view</font></font> <font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot; color=&quot;#3A6955&quot;><font color=&quot;#003399&quot;>info
on each lawyer.</font></font>
<table width=&quot;40%&quot; border=&quot;0&quot; align=&quot;right&quot;>
<tr>
<td height=&quot;27&quot;>
<div align=&quot;left&quot;><font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>
<input type=&quot;checkbox&quot; name=&quot;c3&quot; value=&quot;false&quot; onmouseover=&quot;regContacts(this.form)&quot; onclick=&quot;doIt(this.value)&quot;>
<font size=&quot;1&quot;>All Not Checked</font><BR>
</font><font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>
</font><font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>
<input type=&quot;checkbox&quot; name=&quot;c4&quot; value=&quot;true&quot; onmouseover=&quot;regContacts(this.form)&quot; onclick=&quot;doIt(this.value)&quot;>
<font size=&quot;1&quot;>All Checked<BR>
<a href=&quot;#&quot; onmouseover=&quot;regContacts(lawyerListForm)&quot;><img src=&quot;/images/INQFORM.jpg&quot; border=&quot;0&quot;></a>
</font> </font> </div>
</td>
</tr>
</table>
<p align=&quot;left&quot;><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot; color=&quot;#3A6955&quot;><font color=&quot;#003399&quot;>&nbsp;</font></font><br>
<%
for k = 1 to Ubound(theval)
tmpary = split(theVal(k),&quot;^&quot;)
lawID = tmpary(0)
if ubound(tmpary)>=3 then
if Len(tmpary(3))>0 then
ImageFile = tmpary(3)
else
ImageFile = &quot;no-image.gif&quot;
end if
end if
if ubound(tmpary)>=4 then Description = tmpary(4)
if ubound(tmpary)>=5 then WebAddr = tmpary(5)
if ubound(tmpary)>=6 then Company = tmpary(6)
lDesc = Left(Description,120)
if Len(Description)>120 then lDesc = Left(Description,117) & &quot;...&quot;
%>
<p align=&quot;left&quot;>&nbsp;
<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;4&quot; dwcopytype=&quot;CopyTableCell&quot;>
<tr>
<td bgcolor=&quot;#EFEFEF&quot; valign=&quot;top&quot; rowspan=&quot;2&quot; width=&quot;100&quot;><a href=&quot;#&quot; onmouseover=&quot;getDetails('<%=lawID%>','<%=region%>','<%=lawyerID_str%>');&quot;><img src=&quot;upload_images/<%=ImageFile%>&quot; width=&quot;100&quot; height=&quot;75&quot;></a></td>
<td bgcolor=&quot;#EFEFEF&quot; valign=&quot;middle&quot; width=&quot;200&quot;><a href=&quot;#&quot; onmouseover=&quot;getDetails('<%=lawID%>');&quot;><img src=&quot;images/read-more.gif&quot; width=&quot;88&quot; height=&quot;18&quot; border=&quot;0&quot;></a></td>
<td bgcolor=&quot;#EFEFEF&quot; valign=&quot;middle&quot; width=&quot;350&quot; align=&quot;center&quot;><a href=&quot; target=&quot;_blank&quot;><font size=&quot;1&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;><%=webAddr%></font></a></td>
<td bgcolor=&quot;#FFFFFF&quot; valign=&quot;top&quot; nowrap><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot; color=&quot;#207468&quot;>Include<br>
for contact</font></td>
<td bgcolor=&quot;#FFFFFF&quot; valign=&quot;middle&quot; nowrap align=&quot;center&quot;>
<input type=&quot;checkbox&quot; name=&quot;selectedcontacts&quot; value=&quot;<%=lawID%>&quot; onclick=&quot;regContacts(this.form)&quot; checked>
</td>
</tr>
<tr>
<td bgcolor=&quot;#EFEFEF&quot; valign=&quot;top&quot; colspan=&quot;4&quot; height=&quot;57&quot;><font size=&quot;1&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;><b><%=Company%></b><br>
<%=CheckStringOut(lDesc)%></font></td>
</tr>
<tr>
<td colspan=&quot;5&quot;><img src=&quot;images/spacer.gif&quot; width=&quot;400&quot; height=&quot;10&quot;></td>
</tr>
</table>
<br>
<%
next 'k
%>
</td>
<td bgcolor=&quot;#EFEFEF&quot; valign=&quot;top&quot; align=&quot;center&quot;><img src=&quot;images/connect-form.jpg&quot; width=&quot;258&quot; height=&quot;34&quot;><br>
<font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot; color=&quot;#003399&quot;>Email
all Law Firms on this page with Inquiry Form.</font><br>
<iframe frameborder=&quot;0&quot; id=&quot;lawDetails&quot; SRC=&quot;contact.asp?region=<%=Server.URLEncode(region)%>&lawtype=<%=Server.URLEncode(lawtype)%>&lawyerID_str=<%=Server.URLEncode(lawyerID_str)%>&quot; HEIGHT=&quot;500&quot; WIDTH=&quot;300&quot; MARGINHEIGHT=&quot;0&quot; SCROLLING=&quot;NO&quot; ALLOWTRANSPARENCY=&quot;true&quot;></iframe></td>
</tr>

</table>
</td>
</tr>
<tr>
<td valign=&quot;top&quot; colspan=&quot;2&quot; background=&quot;images/bgimage-bottom.jpg&quot;> <img src=&quot;images/spacer.gif&quot; width=&quot;10&quot; height=&quot;10&quot;></td>
</tr>
<tr>
<td colspan=&quot;2&quot;><a HREF=&quot;index.asp&quot; ONMOUSEOVER=&quot;changeImages('button_home02', 'images/button_home02-over.gif'); return true;&quot; ONMOUSEOUT=&quot;changeImages('button_home02', 'images/button_home02.gif'); return true;&quot;><img src=&quot;images/button_home02.gif&quot; width=&quot;45&quot; height=&quot;31&quot; NAME=&quot;button_home02&quot; border=&quot;0&quot;></a><img src=&quot;images/divider.gif&quot; width=&quot;12&quot; height=&quot;31&quot;><a HREF=&quot;about.htm&quot; ONMOUSEOVER=&quot;changeImages('button_about02', 'images/button_about02-over.gif'); return true;&quot; ONMOUSEOUT=&quot;changeImages('button_about02', 'images/button_about02.gif'); return true;&quot;><img src=&quot;images/button_about02.gif&quot; width=&quot;83&quot; height=&quot;31&quot; NAME=&quot;button_about02&quot; border=&quot;0&quot;></a><img src=&quot;images/divider.gif&quot; width=&quot;12&quot; height=&quot;31&quot;><a HREF=&quot;privacy.htm&quot; ONMOUSEOVER=&quot;changeImages('button_privacy02', 'images/button_privacy02-over.gif'); return true;&quot; ONMOUSEOUT=&quot;changeImages('button_privacy02', 'images/button_privacy02.gif'); return true;&quot;><img src=&quot;images/button_privacy02.gif&quot; width=&quot;56&quot; height=&quot;31&quot; NAME=&quot;button_privacy02&quot; border=&quot;0&quot;></a><img src=&quot;images/divider.gif&quot; width=&quot;12&quot; height=&quot;31&quot;><a HREF=&quot;registration.asp&quot; ONMOUSEOVER=&quot;changeImages('button_account02', 'images/button_account02-over.gif'); return true;&quot; ONMOUSEOUT=&quot;changeImages('button_account02', 'images/button_account02.gif'); return true;&quot;><img src=&quot;images/button_account02.gif&quot; width=&quot;88&quot; height=&quot;31&quot; border=&quot;0&quot; NAME=&quot;button_account02&quot;></a><img src=&quot;images/divider.gif&quot; width=&quot;12&quot; height=&quot;31&quot;><a HREF=&quot;contact.htm&quot; ONMOUSEOVER=&quot;changeImages('button_contact02', 'images/button_contact02-over.gif'); return true;&quot; ONMOUSEOUT=&quot;changeImages('button_contact02', 'images/button_contact02.gif'); return true;&quot;><img src=&quot;images/button_contact02.gif&quot; width=&quot;73&quot; height=&quot;31&quot; NAME=&quot;button_contact02&quot; border=&quot;0&quot;></a><img src=&quot;images/bottom02.gif&quot; width=&quot;404&quot; height=&quot;31&quot;></td>
</tr>
<%
end if 'lawyerExists
%>
</table>

<ul>
<li><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;>
<a href=&quot;free-listing.asp&quot;>Complete
National Lawyer Directory</a></font></li>
<li><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;><a href=&quot;registration.asp&quot;>Add
url</a><br>
</font></li>
</ul>
<hr size=&quot;1&quot; align=&quot;left&quot; noshade>
<%

if fso.FileExists(theFile_footer) then
Set f = fso.OpenTextFile(theFile_footer,1,true)
theFooter = f.ReadAll()
else
theFooter = &quot;&quot;
end if

%>
<blockquote><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<!--footer here-->
<%=theFooter%> <br>
</form>
<br>
&nbsp;</font></blockquote>
<hr size=&quot;1&quot; align=&quot;left&quot; noshade>
<font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>&nbsp;© 2003 All rights
reserved. <br>
&nbsp;&nbsp;<a href=&quot;mailto:info@lawyer-connect.com&quot;>info@lawyer-connect.com</a><br>
<br>
&nbsp;&nbsp;<a href=&quot; target=&quot;_blank&quot;>New
York Web Designer-Design</a></font>
<map name=&quot;Map&quot;>
<area shape=&quot;rect&quot; coords=&quot;108,32,176,48&quot; href=&quot;read-more.htm&quot;>
</map>
<br>
<!-- web tools statistics hit counter code -->
<script language=&quot;javascript&quot;>
var data,nhp,ntz,rf,sr;document.cookie='__support_check=1';nhp='http';
rf=document.referrer;sr=document.location.search;
if(top.document.location==document.referrer
|| (document.referrer == '' && top.document.location != ''))
{rf=top.document.referrer;sr=top.document.location.search}
ntz=new Date();if((location.href.substr(0,6)=='https:') ||
(location.href.substr(0,6)=='HTTPS:'))nhp='https';
data='&an='+escape(navigator.appName)+ '&ck='+document.cookie.length+
'&rf='+escape(rf)+ '&sl='+escape(navigator.systemLanguage)+
'&av='+escape(navigator.appVersion)+ '&l='+escape(navigator.language)+
'&pf='+escape(navigator.platform)+ '&pg='+escape(location.pathname);
if(navigator.appVersion.substring(0,1)>'3') {data=data+'&cd='+
screen.colorDepth+'&rs='+escape(screen.width+ ' x '+screen.height)+
'&tz='+ntz.getTimezoneOffset()+'&je='+ navigator.javaEnabled()};
document.write('<img border=0 hspace=0 '+
'vspace=0 width=1 height=1 src=&quot;'+nhp+'://counter2.hitslink.com/'+
'statistics.asp?v=1&s=201&acct=lawyer'+data+'&quot;>');</script>
<script language=&quot;javascript1.2&quot;>document.write('<');
document.write('!-- ');</script>
<noscript> <img border=&quot;0&quot; hspace=&quot;0&quot; vspace=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot; src=&quot;<!--//-->
<!-- End statistics web tools hit counter code -->
<map name=&quot;Map2&quot;> </map>
</body>
</html>
 
right defore line 224

if (<%=ubound(theval)%> > 1)

add this

<%
if not isArray(theval) then
dim theval(0)
end id

%>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Mwolf I added the line:
<%
if not isArray(theval) then
dim theval(0)
end id
%>

but for some reason in the code editor the not, dim, and end are not colored blue which tells me that the code is not being read correctly. When i pasted the code in a new page it looked fine ( if not was blue, dim was blue and end was blue)

Now I tried both with and without the <% %> blocks and same thing, so I think that for some reason, inside the function the &quot;if not is not being read correctly&quot; maybe there are limitations to the function coding. Do you have any ideas about this?
the error I get now is:

Microsoft VBScript compilation (0x800A0411)
Name redefined
/infotest.asp, line 226, column 4

thx
 
name redefined means that you've already DIMed theVal

try this

<%
if not isArray(theval) then
redim theval(0)
end id
%>



Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
great, thanks

now it works %)
 
awesome - you worked around my typo.

&quot;end id&quot;?????

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Yeah, I actually thought about thinking about what you wrote.... thx ..



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top