Script error

M

Mark A. Sam

Hello,

For years my ASP used the following Script:

<%while NOT rs.EOF
Datel = ""
Recur = ""
if rs("Recurring") = False then
DateL = rs("DateLoading")
else
Recur = "Recurring"
End If
if rs("TrailerLength") =0 then
tLength = ""
else
tlength = rs("TrailerLength")
End If
%>

This never seemed to be a problem, but today I was doing a test of my search
page which utilizes this code and got a runtime error. The problem was the
line,

tlength = rs("TrailerLength")

Which didn't like "" as a value for rs("TrailerLength")

Do I changed
if rs("TrailerLength") =0 then
tLength = ""
to
if rs("TrailerLength") = "" then
tLength = 0
which solved the problem. To script it now:

<%while NOT rs.EOF
Datel = ""
Recur = ""
if rs("Recurring") = False then
DateL = rs("DateLoading")
else
Recur = "Recurring"
End If
if rs("TrailerLength") = "" then
tLength = 0
else
tlength = rs("TrailerLength")
End If
%>

Does anyone know why suddenly I can't assign "" to the variable tlength?

I have another problem with updated records, and an answer to this may help
me to debug that.

Thanks and God Bless,

Mark A. Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top