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

Keeping a DB clean

Status
Not open for further replies.

Ragol1

Programmer
Oct 25, 2001
315
US
I wonder if someone could show me how to keep a DB clean when I pass data from a form to an ASP page then the DB,
I Think there are certain things a DB doesnt like or Even ASP doesnt like to be in a form, and i just want to know how to strip those things before they go to the database.


Am I making sense?????

Nick
 
You can submit anything from an html form into a database.
Here are some rules:

If you have a form where the user can fill in text:
Make sure to set the maxlength property of an input text
box so the user cannot exeed the length of characters of
the db field.
In your update statement replace all ' characters with ''
like so:
replace(request("formfield"),"'","''",1,1,1)

If you have to insert a date see this url:

If you have to insert numbers:
I suggest a good client script (code is not availeble on
my site yet) to check if the data filled in is a number,
has not to many decimal places, is not too small/big
etc..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top