Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How does sql injection or attack done.? example code

How can sql injection done in the code below?
VB
olesql = "insert into table (rr_colums) values ('" & sum & "')"
                Dim olecmd As New OleDb.OleDbCommand
                olecmd.CommandText = olesql
                olecmd.Connection = oleconn
                olecmd.ExecuteNonQuery()
                olecmd.Dispose()
Posted
Updated 4-Nov-11 0:58am
v2

It depends from where value of your sum variable has been initialized.

Generally in case when values from user-input controls like "Textbox" are concatenated to plain SQL Queries then it increases the possibility of threat of "SQL Injection".

Have a look at below links for more information.
http://msdn.microsoft.com/en-us/library/ms161953.aspx

http://msdn.microsoft.com/en-us/library/ff648339.aspx
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900