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

HELP!!!! - VBScript ASP page - type mismatch - HELP!!!!

Status
Not open for further replies.

CharlieMike73

Programmer
May 17, 2002
120
US
HELP!!!!

I have a ASP Page that for some reason or another is giving me a type mismatch when I try to add to the number (???).
Code:
<%
Dim NextIndex

NextIndex = (rsNextIndex.Fields.Item(&quot;NEXT_INDEX&quot;).Value)
NextIndex = NextIndex + 1
%>
and
Code:
<%
Dim NextIndex

NextIndex = (rsNextIndex.Fields.Item(&quot;NEXT_INDEX&quot;).Value) + 1
%>
both produce the following error...
Code:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/m_o/mats/reports/TMPd5kgg8iid6.asp, line 496

Line 469 is the 'NextIndex = NextIndex + 1' line in the first example!

So...
How do I ensure that the Type is a number in a VBScript ASP Page?

 
First, you should check out the FAQ in my signature.
Second, a google search probably could have netted you the answer
Third, cInt, cDbl, cLng, cSng, ...

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
<%
Dim NextIndex

NextIndex = CInt(rsNextIndex.Fields.Item(&quot;NEXT_INDEX&quot;).Value)
NextIndex = NextIndex + 1
%>
---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
Let me add that the source is from a database, and is from a field that is marked as a number field
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top