🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1089

Re: TParameters->ParseSQL strange behaivour

#1089
From: Viatcheslav V. Vassiliev
Date: Mon, 22 Nov 2004 17:16
48 lines
2329 bytes
ParseSQL converts :paramname syntax into ?. AnsiString is reference counted.
S is changed because of S = ... newS has changed because it references the
same string. Try add

newS.Unique();

before calling ParseSQL().

//------------------------------------------
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)

"Niyazi Unugur" <unugurn@kentkart.com.tr> �������/�������� � ��������
���������: news:41a1f912$1@newsgroups.borland.com...
>
> As described in help;
>
> AnsiString __fastcall ParseSQL(AnsiString SQL, bool DoCreate);
>
> TParameters ParseSQL has the above syntax;
>
> Below is my sample code for testing
>
> ...
>
> AnsiString S = "SELECT * FROM tableA  WHERE p1 = :param1 and p2 = :param2
and p3 = :param3";
> AnsiString newS = S;
>
> Query->Parameters->ParseSQL(S, true);
>
> please debug values S and newS
>
> you will see both S and newS has "? ? ?" values;
>
> How S can changed?
> How newS changes !!!!
>
> What is the problem?
>
> Thanks,
>
> Niyazi Unugur
>
Technical Details
Message-ID: <41a21ee6@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!newsfeed.bit.nl!newsfeed.bit.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41a1f912$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,388088aac66683ec
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <41a1f912$1@newsgroups.borland.com>
Subject: Re: TParameters->ParseSQL strange behaivour
Date: Mon, 22 Nov 2004 20:16:22 +0300
Lines: 50
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: <41a21ee6@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1101143782 213.234.218.42 (22 Nov 2004 09:16:22 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!newsfeed.bit.nl!newsfeed.bit.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail