<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Query, ListBox , doppelt Einträge]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich mache eine Query Abfrage auf eine Tabelle und da hole ich mir alle Nummern aus der Spalte &quot;Nr&quot; und schreibe diese in eine ListBox.</p>
<pre><code class="language-cpp">while (!Query-&gt;Eof)
  {
   nr=(Query-&gt;FieldByName(&quot;Nr&quot;)-&gt;AsString);
   ListBox1-&gt;Items-&gt;Add(nr);
  }
</code></pre>
<p>Leider habe ich ggf. Nummern nun doppelt in der ListBox.<br />
Kann ich die doppelte Einträge in der Query schon abfangen ?</p>
<p>Oder muss ich eine 2. ListBox haben, damit ich nun durch die 1. durchlaufe und nur die einmal vorkommendenn Einträge rausschreibe ?</p>
<p>Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/100018/query-listbox-doppelt-einträge</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Jul 2026 11:08:49 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/100018.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Feb 2005 22:38:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Query, ListBox , doppelt Einträge on Wed, 02 Feb 2005 22:38:04 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich mache eine Query Abfrage auf eine Tabelle und da hole ich mir alle Nummern aus der Spalte &quot;Nr&quot; und schreibe diese in eine ListBox.</p>
<pre><code class="language-cpp">while (!Query-&gt;Eof)
  {
   nr=(Query-&gt;FieldByName(&quot;Nr&quot;)-&gt;AsString);
   ListBox1-&gt;Items-&gt;Add(nr);
  }
</code></pre>
<p>Leider habe ich ggf. Nummern nun doppelt in der ListBox.<br />
Kann ich die doppelte Einträge in der Query schon abfangen ?</p>
<p>Oder muss ich eine 2. ListBox haben, damit ich nun durch die 1. durchlaufe und nur die einmal vorkommendenn Einträge rausschreibe ?</p>
<p>Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/713327</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/713327</guid><dc:creator><![CDATA[Mike_2004]]></dc:creator><pubDate>Wed, 02 Feb 2005 22:38:04 GMT</pubDate></item><item><title><![CDATA[Reply to Query, ListBox , doppelt Einträge on Wed, 02 Feb 2005 23:27:06 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>für MySQL gibt es dafür das Schlüsselwort <strong>DISTINCT</strong></p>
<pre><code>SELECT DISTINCT Nr FROM &lt;tablename&gt;
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/713355</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/713355</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 02 Feb 2005 23:27:06 GMT</pubDate></item><item><title><![CDATA[Reply to Query, ListBox , doppelt Einträge on Thu, 03 Feb 2005 07:37:31 GMT]]></title><description><![CDATA[<p>sonst kannst du das auch einfach nach dem querry vor dem reinschreiben in die listbox abfangen</p>
<pre><code class="language-cpp">while (!Query-&gt;Eof)
  {
     nr=(Query-&gt;FieldByName(&quot;Nr&quot;)-&gt;AsString);
     if (ListBox1-&gt;Items-&gt;IndexOf(nr) == -1)
     {
         ListBox1-&gt;Items-&gt;Add(nr);
     }
  }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/713418</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/713418</guid><dc:creator><![CDATA[BigNeal]]></dc:creator><pubDate>Thu, 03 Feb 2005 07:37:31 GMT</pubDate></item><item><title><![CDATA[Reply to Query, ListBox , doppelt Einträge on Fri, 04 Feb 2005 18:41:32 GMT]]></title><description><![CDATA[<p>Hallo Zusammen,</p>
<p>beide Möglichkeiten bekomme ich zum laufen, allerdings dauern die ewig (Bei 6 Datensätzen).</p>
<p>Gibt es hier eine andere Möglichkeit ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/714795</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/714795</guid><dc:creator><![CDATA[Mike_2004]]></dc:creator><pubDate>Fri, 04 Feb 2005 18:41:32 GMT</pubDate></item><item><title><![CDATA[Reply to Query, ListBox , doppelt Einträge on Fri, 04 Feb 2005 19:33:21 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das es so lange dauern soll, kann ich mir nicht vorstellen (gerade bei der SQL-Abfrage). Das muß an deiner Verarbeitung liegen. Zeig mal mehr aktuellen Code.<br />
Ich hoffe mal, das du noch das</p>
<pre><code class="language-cpp">Query-&gt;Next();
</code></pre>
<p>in der Schleife eingefügt hast? sonst wirds ne Endlos-schleife</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/714835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/714835</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Fri, 04 Feb 2005 19:33:21 GMT</pubDate></item><item><title><![CDATA[Reply to Query, ListBox , doppelt Einträge on Sat, 05 Feb 2005 02:17:48 GMT]]></title><description><![CDATA[<p>kann ich mir auch schlecht vorstellen...<br />
etwas code würde sicher weiterhelfen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/714991</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/714991</guid><dc:creator><![CDATA[BigNeal]]></dc:creator><pubDate>Sat, 05 Feb 2005 02:17:48 GMT</pubDate></item></channel></rss>