Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21159

Apostrophe in String Data causes error.

$
0
0
Hi

I am a noob to VB6 but am supporting some code written by another person a long time ago. Upto now I have been doing OK but I recently hit an issue that is outside of my experience and I was hoping someone could point me in the right direction. The program in question is auto-processing emails (the client is Outlook) and performing actions based upon the content of the email.

The issue I have hit however is that for the first time we received an email from an sender who's email address contained an apostrophe character > ' < e.g. rosie.o'grady@domain.com which crashed the email lookup function. The failing code is as follows:

Private Function FindRecord(EmlDBObj As Object, SQLSearchString As String)
If EmlDBObj.RecordCount > 0 Then
EmlDBObj.MoveFirst
EmlDBObj.Find SQLSearchString, , adSearchForward
End If

I would greatly appreciate any suggestions of how to handle the apostrophe issue.

Thanks in advance .... Colin

Viewing all articles
Browse latest Browse all 21159

Trending Articles