|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
SQL in Visual Basic
I have sql statement in my Visual Basic code
"SELECT * from Location WHERE Description = '" & txtName & "'" where txtName is an object on the VB form. When the user input includes a single quote, i get a syntax error in the sql statement. If the input does not contain a single quote, it works just find. How do i get around this without restricting the user with respect to input data? |
|
#2
|
||||
|
||||
|
try this site. It contains a function called padquotes.
http://support.microsoft.com/defaul...kb;EN-US;190742 |
|
#3
|
||||
|
||||
|
Code:
Public Function ReplaceQuotes(ByVal strValue As String) As String strValue = Replace(strValue, "'", "''") ReplaceQuotes = strValue End Function |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > SQL in Visual Basic |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|