Article View: free.it.visual-basic
Article #3801Re: vb and sql
From: WishMaster
Date: Sun, 07 Apr 2002 15:40
Date: Sun, 07 Apr 2002 15:40
27 lines
1765 bytes
1765 bytes
"chaim_c" <chaim_c@zahav.net.il> ha scritto nel messaggio
news:a8nfl0$ofb$1@news.inter.net.il...
> how can ic change this code
> ssql="select * from manage where name='" & txtname.text & "'"
> that if txtname.text contains ' it's not make an error
>
> thanx
private function doubleColumn(strIn as string) as string
dim i as long
dim strOut as string
dim controllo as string
for i = 0 to len(strIn)
controllo = mid(strIn,i,1)
if controllo = "'" then strOut = strOut & "''" else strOut = strOut
& controllo
next
doubleColumn = controllo
end function
ssql="select * from manage where name='" & doubleColumn(txtname.text) & "'"
Technical Details
Message-ID:
<eNZr8.134003$%g7.4247692@twister2.libero.it>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!newsfeed.icl.net!opentransit.net!fr.clara.net!heighliner.fr.clara.net!news.mailgate.org!nntp.infostrada.it!twister2.libero.it.POSTED!not-for-mailReferences:
<a8nfl0$ofb$1@news.inter.net.il>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f94ee,a132b2275c7ea58 X-Google-Attributes: gidf94ee,public X-Google-ArrivalTime: 2002-04-07 08:42:11 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!newsfeed.icl.net!opentransit.net!fr.clara.net!heighliner.fr.clara.net!news.mailgate.org!nntp.infostrada.it!twister2.libero.it.POSTED!not-for-mail From: "WishMaster" <wish@fastensb.cjb.net> Newsgroups: free.it.visual-basic References: <a8nfl0$ofb$1@news.inter.net.il> Subject: Re: vb and sql Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: <eNZr8.134003$%g7.4247692@twister2.libero.it> Date: Sun, 7 Apr 2002 17:40:59 +0200 NNTP-Posting-Host: 62.98.44.110 X-Complaints-To: abuse@inwind.it X-Trace: twister2.libero.it 1018194122 62.98.44.110 (Sun, 07 Apr 2002 17:42:02 MET DST) NNTP-Posting-Date: Sun, 07 Apr 2002 17:42:02 MET DST Organization: [Infostrada]