Article View: borland.public.cppbuilder.database.ado
Article #1141Re: question about '
From: Viatcheslav V. Vassiliev
Date: Fri, 01 Oct 2004 10:08
Date: Fri, 01 Oct 2004 10:08
26 lines
1910 bytes
1910 bytes
Double ' inside string - i.e.
insert into some_table (some_col) values ('lil''devil')
You could do this with AnsiQuotedStr(strValue, "'"). Or, better way, use
parameters in query and pas string as parameter.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Daniele Borini" <borini@infinito.it> ???????/???????? ? ???????? ?????????:
news:415c78d9@newsgroups.borland.com...
> hi averybody,
> maybe it's the right place, but i've got this problem:
> when i need to build a query which inserts or updates a table with
> string fields i use ' to indicate string fields, but i've got errors
> when the string contains ' itself e.g. 'lil'devil' causes an error, i
> tried to replace ' with its ASCII value but it's the same.. how could i
do?
> I'm using ADO+BCB6+ACCESS DB.
> TIA Dan
Technical Details
Message-ID:
<415d2c88@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<415c78d9@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,797d322221a52654 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <415c78d9@newsgroups.borland.com> Subject: Re: question about ' Date: Fri, 1 Oct 2004 14:08:07 +0400 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 213.234.218.42 Message-ID: <415d2c88@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1096625288 213.234.218.42 (1 Oct 2004 03:08:08 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail