Replace: Problems stripping out Comma for a Integer field
- From: <jason@xxxxxxxxxxxxxxx>
- Date: Fri, 9 Sep 2005 11:06:53 -0400
Interesting problem: If a user puts a Comma into an integer field I will get
a data type error.
I tried Replacing it with a blank space:
FUNCTION FixApos(Var)
FixApos=Replace(Var, "'", "")
FixApos=Replace(Var, ",", "")
END FUNCTION
But still pick up the error. Is tis because the Int field sees the empty
space as a 'character'?
I have no resorted to redirecting user back to form page if there is a comma
detected:
FUNCTION FixApos(Var)
FixApos=Replace(Var, "'", "")
FixApos=Replace(Var, ",", "")
If Instr(Var,",") then
response.redirect "FormAdd.asp?Error=Comma"
End If
' this replaces a single apostrophe ( ' ) with two single apostrophes ( '').
Note: two single apostrophes, not one quotation mark
END FUNCTION
Bsides client side validation there surely has to be a better way to strip
out commas for an integer field on the fly. I also tried replacing with a
NULL but error said this was inproper use of Replace function.
Could really use some help here.
Thanks
Jason
.
- Follow-Ups:
- Re: Replace: Problems stripping out Comma for a Integer field
- From: Bob Barrows [MVP]
- Re: Replace: Problems stripping out Comma for a Integer field
- From: Michael D. Kersey
- Re: Replace: Problems stripping out Comma for a Integer field
- From: Bob Lehmann
- Re: Replace: Problems stripping out Comma for a Integer field
- From: Bob Barrows [MVP]
- Re: Replace: Problems stripping out Comma for a Integer field
- From: jason
- Re: Replace: Problems stripping out Comma for a Integer field
- Prev by Date: Re: Insert Proc. Accept Null Values?
- Next by Date: Re: select statement for in inclusion list
- Previous by thread: Controlling field sizes of a table created with response.write
- Next by thread: Re: Replace: Problems stripping out Comma for a Integer field
- Index(es):
Relevant Pages
|