Re: Storing appostrophe's in SQL
From: Michel Pierron (michel.pierron_at_free.fr)
Date: 08/05/04
- Next message: exceller: "Re: 'Saved' Property not working"
- Previous message: Ed: "Re: Disabled Macros"
- In reply to: Jeff: "Storing appostrophe's in SQL"
- Next in thread: Rob Bovey: "Re: Storing appostrophe's in SQL"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 6 Aug 2004 00:13:10 +0200
Hi Jeff,
for example:
Function FixApostrophy(ByVal sSQL As String) As String
Dim sPhrase As String, wLength As Integer, m As Integer
wLength = Len(sSQL)
For m = 1 To wLength
If Mid(sSQL, m, 1) = "'" Then
sPhrase = sPhrase & "''"
Else
sPhrase = sPhrase & Mid(sSQL, m, 1)
End If
Next
FixApostrophy = sPhrase
End Function
MP
"Jeff" <anonymous@discussions.microsoft.com> a écrit dans le message de
news:0f8701c47b31$8dca5d00$a401280a@phx.gbl...
> I have a text box that allows the user to type in free
> form text. I want to save it to a SQLServer database
> table. If the user types in <Here's Johnny!>, I can insert
> it into SQLServer by inserting the text string <Here''s
> Johnny!>
>
> My question: is there a function that does this, or do I
> process the text string before I insert it to double all
> the appostrophe's?
>
> Thanks!
- Next message: exceller: "Re: 'Saved' Property not working"
- Previous message: Ed: "Re: Disabled Macros"
- In reply to: Jeff: "Storing appostrophe's in SQL"
- Next in thread: Rob Bovey: "Re: Storing appostrophe's in SQL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|