securing my site

Hello Experts

My first time posting here, and relatively new to EE, so be gentle!

Recently, a friend of mine asked me if I could help him out with his site which is written in classic asp. Being from the VB Programming world, I thought it would be a good challenge and also a good way to build up my web development skills, which are quite limited to say the least!

The first task he gave me was to help secure his site a bit, specifically going through and changing the sql statements over to using the command object and parameterized queries. I did a little research on them, and think I understand the concept and theory behind them, but am having trouble getting the syntax right.

could someone post some code and/or links to a simple example on how they work?

Many thanks!
c lAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontySenior Web Developer / CEO of Commented:
first off, welcome to EE :)

I've answered a few questions here on EE about this very topic, here is one example using parameterized queries:

Also, make sure you "clean" your data before inserting it into the database. Check for proper values, data types, and even the length of data being inserted (if it's a small field and a huge string is being inserted, it could be someone trying to put in a hijack script.

for understanding the theory behind sql injection, wikipedia has a good article explaining the theory:

Welcome to EE!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Let's see what you are starting with.   Can you post your sample code you have now?
c lAuthor Commented:
Monty - Beautiful, exactly what I'm looking for, thank you :)

Scott - I really don't have any code yet with regards to creating parameterized queries, I'm trying to find specific examples that I can understand, I'm going to play around some with the example in the link Monty posted.

I'll probably have lots of more questions as I go along, fair warning!!!
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

c lAuthor Commented:
thank you - exactly what I'm looking for!
c lAuthor Commented:
crud - I accepted the wrong answer. how do I change it to Monty's answer?
c lAuthor Commented:
Thank you Gary!
Big MontySenior Web Developer / CEO of Commented:
Glad it was helpful :)

happy programming!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.