>< You are setting yourself up for SQL injection on this one. Consider what would happen if I placed this code into the text box:
' OR 0 = 0; DROP TABLE tbl_group_contact --
Your sql string literally becomes this:
select * from tbl_group_contact where userName ='' OR 0 = 0; DROP TABLE tbl_group_contact --'
(anything after -- is commented out)
Do a google search on paramertized queries in ADO as those are alot safer.
In regards to your specific problem, check for the absence of data in the username field, if it is blank return an error message to the user so that the sql statement isnt executed.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========