Unless your request.form value actually has two apostrophes in it, you
shouldn't see two apostophes when you pull the value back out of the
database or look at it directly in the database. You aren't actually
inserting two into the database. '' = ' when inserted. I think we need to
see a sample of how this is happening to you.
Ray at home
"middletree" <> wrote in message
news:#...
> I am doing it when I do a request.form, before it goes into the database
>
>
> "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
> news:...
> > Yes, they both do the same thing. But you do NOT pass that value
through
> > the function when you are RETREIVING a value from the database. Is that
> > what you're doing? Are you doing something like:
> >
> > Response.Write SafeIn(Recordset("item"))
> >
> > Ray at work
> >
> > "middletree" <> wrote in message
> > news:%...
> > > Ray recently answered my question about apostrophe replacement with
> advice
> > > on how to use 2 functions for hwich he gave me some code, called
SafeIn
> > and
> > > Safeout
> > >
> > > I'm having a hard time seeing the difference. In fact, the results are
> the
> > > same.
> > >
> > > Here's my old code:
> > >
> > > Replace(Trim(Request.Form("InternalDesc")),"'","'' ")
> > >
> > >
> > > and here is what Ray suggests:
> > > SafeIn(Request.Form("InternalDesc"))
> > >
> > > and
> > > Function SafeIn(theString)
> > > SafeIn = Replace(theString, "'", "''")
> > > End Function
> > >
> > >
> > > The results are the same: when I type in:
> > > won't
> > >
> > > One the page where it is displayed, it looks like:
> > > won''t
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
|