Click here to Skip to main content
15,924,452 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: single quotes in vb.net Pin
Sonia Gupta29-May-07 2:01
Sonia Gupta29-May-07 2:01 
GeneralRe: single quotes in vb.net Pin
Colin Angus Mackay29-May-07 3:14
Colin Angus Mackay29-May-07 3:14 
GeneralRe: single quotes in vb.net Pin
leckey29-May-07 4:02
leckey29-May-07 4:02 
GeneralRe: single quotes in vb.net Pin
Dave Kreskowiak29-May-07 4:22
mveDave Kreskowiak29-May-07 4:22 
GeneralRe: single quotes in vb.net Pin
Colin Angus Mackay29-May-07 6:34
Colin Angus Mackay29-May-07 6:34 
GeneralRe: single quotes in vb.net Pin
Dave Kreskowiak29-May-07 6:52
mveDave Kreskowiak29-May-07 6:52 
GeneralRe: single quotes in vb.net Pin
Paul Conrad29-May-07 8:06
professionalPaul Conrad29-May-07 8:06 
AnswerRe: single quotes in vb.net Pin
Guffa29-May-07 8:15
Guffa29-May-07 8:15 
I think that you should read what you are linking to yourself. Wink | ;)

If the values are encoded correctly, there is no problem with concatenating string to create an SQL query. It's only if you do it wrong that the code is subject to SQL injections.

Doing it right is not trivial, though, and the methods presented in this thread is for example not at all suitable if you are using an MySQL database. To encode a string for MySQL you would instead replace "\" with "\\", then replace "'" with "\'".

So, using parameterised queries is good advice. Smile | :) It's not, however, the only way to protect the code against SQL injections.

---
single minded; short sighted; long gone;

GeneralRe: single quotes in vb.net Pin
advansis29-May-07 4:41
advansis29-May-07 4:41 
GeneralRe: single quotes in vb.net Pin
Colin Angus Mackay29-May-07 6:31
Colin Angus Mackay29-May-07 6:31 
GeneralRe: single quotes in vb.net Pin
Paul Conrad29-May-07 8:08
professionalPaul Conrad29-May-07 8:08 
QuestionRuntime Controls in VB6 Pin
Kumaran21cen28-May-07 23:25
Kumaran21cen28-May-07 23:25 
AnswerRe: Runtime Controls in VB6 Pin
Navneet Hegde28-May-07 23:34
Navneet Hegde28-May-07 23:34 
AnswerRe: Runtime Controls in VB6 Pin
SimulationofSai29-May-07 0:11
SimulationofSai29-May-07 0:11 
QuestionGet current user's logon password Pin
Steven J Jowett28-May-07 23:21
Steven J Jowett28-May-07 23:21 
AnswerRe: Get current user's logon password Pin
Navneet Hegde28-May-07 23:32
Navneet Hegde28-May-07 23:32 
GeneralRe: Get current user's logon password Pin
Steven J Jowett28-May-07 23:39
Steven J Jowett28-May-07 23:39 
GeneralRe: Get current user's logon password Pin
Navneet Hegde29-May-07 0:03
Navneet Hegde29-May-07 0:03 
AnswerRe: Get current user's logon password Pin
SimulationofSai28-May-07 23:58
SimulationofSai28-May-07 23:58 
GeneralRe: Get current user's logon password Pin
Steven J Jowett29-May-07 0:10
Steven J Jowett29-May-07 0:10 
GeneralRe: Get current user's logon password Pin
Kiran Kumar B29-May-07 17:31
Kiran Kumar B29-May-07 17:31 
GeneralRe: Get current user's logon password Pin
Kiran Kumar B29-May-07 17:35
Kiran Kumar B29-May-07 17:35 
GeneralRe: Get current user's logon password Pin
Steven J Jowett29-May-07 22:10
Steven J Jowett29-May-07 22:10 
QuestionCreating VPN Pin
carsell28-May-07 23:20
carsell28-May-07 23:20 
QuestionFlexGrid in VB6 Pin
Kumaran21cen28-May-07 23:14
Kumaran21cen28-May-07 23:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.