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

Type Mismatch error

Status
Not open for further replies.

sweetleaf

Programmer
Jan 16, 2001
439
CA
Hi,

I have an asp page which submits a value (x) from a text control to another page for processing.
The data type of the field which i am trying to insert into is NUMBER(4) -oracle.
The error I am getting is "Type Mismatch". I have tried casting x as Cint,Cdbl,Clng and have tried not casting x and still get this error regardless. Does anyone know why?

page 1:
<input type=text id=&quot;x&quot; name=&quot;x&quot; value=&quot;123&quot;>
(submits to page 2)

page 2:
pri_v=Request.form(&quot;x&quot;) & &quot;&quot;
.
.

With rst
.Fields(&quot;priority&quot;) = CInt(x)
etc...

Any help would be appreciated!
 
this might be a typo:

You have:
.Fields(&quot;priority&quot;) = CInt(x)

Should Be?:
.Fields(&quot;priority&quot;) = CInt(pri_v)

Also why is the & &quot;&quot; following this line of code
pri_v=Request.form(&quot;x&quot;) & &quot;&quot;

Kris
- If it ain't broke, fix it till it is.
 
oops! sorry bout that, the code should be:

page 1:
<input type=text id=&quot;x&quot; name=&quot;x&quot; value=&quot;123&quot;>
(submits to page 2)

page 2:
pri_v=Request.form(&quot;x&quot;)
.
.

With rst
.Fields(&quot;priority&quot;) = pri_v
etc...
(&quot;priority&quot; in the db is NUMBER(4))

Thanks for pointing that out.
 
What about:

page 2:
Dim pri_v
If Request.form(&quot;x&quot;) = &quot;&quot; Then
pri_v = 0
Else
pri_v = CInt(Trim(Request.form(&quot;x&quot;)))
End If


Kris
- If marriage were outlawed, only outlaws would have in-laws.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top