Hi!
I've been working on a program that will help us keep track of our subscribers. Among other things, a user should be able to find a subscribers Zone number by entering their community name. This works for most part, except if the community name has an apostrophe in it(and you wouldnt belive how many of those there are!). Then it throws the following error:
2147217900(80040e14) Syntax error (operator missing) in query expression 'Community='Jean D'Or''
I'd really appreciate any tips or pointers on how to get around this problem. The code snippet follows:
strSQL = "SELECT * FROM tblCommunity WHERE Community = '" & txtCommunity.Text & "'"
With rsZoneNo
.ActiveConnection = cnCon
.Source = strSQL
.LockType = adLockOptimistic
.CursorLocation = adUseServer
.Open
End With
intZoneNo = rsZoneNo("ZoneNo"
rsZoneNo.close
Thanks,
Sheryll
I've been working on a program that will help us keep track of our subscribers. Among other things, a user should be able to find a subscribers Zone number by entering their community name. This works for most part, except if the community name has an apostrophe in it(and you wouldnt belive how many of those there are!). Then it throws the following error:
2147217900(80040e14) Syntax error (operator missing) in query expression 'Community='Jean D'Or''
I'd really appreciate any tips or pointers on how to get around this problem. The code snippet follows:
strSQL = "SELECT * FROM tblCommunity WHERE Community = '" & txtCommunity.Text & "'"
With rsZoneNo
.ActiveConnection = cnCon
.Source = strSQL
.LockType = adLockOptimistic
.CursorLocation = adUseServer
.Open
End With
intZoneNo = rsZoneNo("ZoneNo"
rsZoneNo.close
Thanks,
Sheryll