Apostrophe and a ASP Access Database

Results 1 to 2 of 2

Thread: Apostrophe and a ASP Access Database

  1. #1
    Jared Landress Guest

    Default Apostrophe and a ASP Access Database

    Hey guys,<BR><BR>I have a form that gets filled out and on post, gets submitted to a Access Database.<BR><BR>I noticed in the form you can never type a apostrophe (&#039) because if you do, the script dies, so I fixed it with this.<BR><BR>dOpportunity = request.form("Opportunity")<BR>aPos = Instr(dOpportunity, "&#039")<BR>If aPos &#062; 0 Then<BR> first = Left(dOpportunity, aPos - 1)<BR> last = Right(dOpportunity, Len(dOpportunity) - aPos)<BR> fixed = first & last<BR> dOpportunity = fixed<BR>End If<BR><BR>But how do you do an error check if someone types in more than one apostrophe? (example: Tom&#039s Sportscard&#039s)<BR><BR>Is there anyway to delete all of the apostrophe&#039s or better yet have them not effect anything.<BR>

  2. #2
    Alex Telford Guest

    Default RE: Apostrophe and a ASP Access Database

    Simply replace the apostrophe with 2 of them , works with most databases eg.<BR><BR>dOpportunity = Replace(request.form("Opportunity"),"&#039","&#039 &#039")<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts