validate text field to db field

This is a discussion on "validate text field to db field" within the Classic ASP section. This forum, and the thread "validate text field to db field are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jul 7th, 2006, 00:30
New Member
Join Date: Jul 2006
Location: Canada
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question validate text field to db field

Hello. I am in the process of creating a login script that once users enter in a code, and submit it the asp script will then check what was entered againsty a database. My code isnt working amd from what i know there are no errors. Everything shows up but the lines in certain if statements

Code is attached in a text file.
Attached Files
File Type: txt form_test.txt (1.5 KB, 78 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jul 18th, 2006, 17:48
Junior Member
Join Date: Jul 2006
Location: Manchester
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Re: validate text field to db field

I think you are approaching this wrong.
Ideally you should be using an SQL parameterised query with an ADODB Command although you could use dynamic SQL but it's open to attack so you need to sanitise your user input.

This is the dynamic SQL version which is a bit simpler but I suggest you look into parameters and SQL.

Code: Select all
 
strSQL = "SELECT * "
strSQL = strSQL & " FROM dealercode "
strSQL = strSQL & " WHERE DealerCode = " & replace(user_code,"'","''")
set RS = Conn.Execute(strSQL)
If rs.eof then
       ' code not found
else
       ' code found
end if
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
validate, text, field

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
making text field text disapear Phixon JavaScript Forum 4 Feb 2nd, 2008 07:49
[SOLVED] Validate name field Graisbeck PHP Forum 2 Jan 13th, 2008 15:26
Need javascript to set input field value field jdadwilson JavaScript Forum 3 May 9th, 2007 04:47
Validate a certain field content Syd JavaScript Forum 6 Jan 1st, 2007 01:24
Non-text field Validation NewDesigner JavaScript Forum 6 Nov 24th, 2006 22:34


All times are GMT. The time now is 16:04.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42