🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TParameters->ParseSQL strange behaivour

#992
From: Niyazi Unugur
Date: Tue, 23 Nov 2004 06:28
54 lines
2280 bytes
Thanks for your help...

"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote:
>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: <41a2e69f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <41a1f912$1@newsgroups.borland.com> <41a21ee6@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: "Niyazi Unugur" <unugurn@kentkart.com.tr>
Sender: "Niyazi Unugur" <unugurn@kentkart.com.tr>
Reply-To: "Niyazi Unugur" <unugurn@kentkart.com.tr>
Subject: Re: TParameters->ParseSQL strange behaivour
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 212.174.59.103     
References: <41a1f912$1@newsgroups.borland.com> <41a21ee6@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <41a2e69f$1@newsgroups.borland.com>
Date: 22 Nov 2004 23:28:31 -0700
X-Trace: newsgroups.borland.com 1101194911 207.105.83.66 (22 Nov 2004 23:28:31 -0700)
Lines: 55
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail