[Gambas-user] Insert thext with " ' " in sqlite database

Paolo Fagni paolo.fagni at ...626...
Wed Jan 23 16:06:17 CET 2008


On Jan 23, 2008 3:31 PM, Benoit Minisini <gambas at ...1...>
wrote:

> On mercredi 23 janvier 2008, Paolo Fagni wrote:
> > Hello,
> >
> > I have to insert data in a sqlite database that has this particular form
> :
> >
> > dell'orto
> >
> > I tried to use DB.Quote(string) but the result is
> >
> > 'dell'orto'
> >
> > When I would like to obtain :
> >
> > 'dell''orto'
> >
> > Do I have to change it manually with Replace$() ? Thank you for you
> help.
>
> Actually DB.Quote is not for quoting strings that will be inserted into
> the
> database, but for quoting database identifiers. Anyway I'm not sure it
> should
> not return 'dell''orto'...
>
> To quote database values, you must use the Connection.Subst method, or one
> of
> the following: Edit, Find, Delete, Exec.
>
> Regards,
>
> --
> Benoit Minisini
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>

Thank you very much, since I have a String and I use DB.Exec("INSERT INTO
...") to execute my SQL insertion, I'd go for a Replace$().

Thank you again.

-- 
Paolo Fagni



More information about the User mailing list