battenberg
Burning candles both ends
- Local time
- Today, 11:55
- Joined
- Sep 25, 2006
- Messages
- 118
Hi,
I am using an SQL statement to insert a 'User Notes' string into a record in a table. However, if the strings contains a (; semicolon) or (' appostraphe) it messes up the SQL.
I put this into the onKeypress event to try to capture/combat it..
Although basic code, I dont think that this is the best way to handle it, but it prompts me to sort it out. Does any one have any suggestions...???
or is there a way to handle these characters as variable strings in an SQL statement?
Many Thanks...
I am using an SQL statement to insert a 'User Notes' string into a record in a table. However, if the strings contains a (; semicolon) or (' appostraphe) it messes up the SQL.
I put this into the onKeypress event to try to capture/combat it..
Code:
If KeyAscii = 59 Then MsgBox "Prohibited Character" + vbCrLf + "You cannot use (;) in User Notes", vbCritical
If KeyAscii = 39 Then MsgBox "Prohibited Character" + vbCrLf + "You cannot use (') in User Notes", vbCritical
Although basic code, I dont think that this is the best way to handle it, but it prompts me to sort it out. Does any one have any suggestions...???
or is there a way to handle these characters as variable strings in an SQL statement?
Many Thanks...