<?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[Sind mehrere DataSources, DataSets für ein DBObjekt möglich?]]></title><description><![CDATA[<p>Hallo,<br />
ich habe eine grundsätzlich Frage zu DataSource und DataSet. Ich versuche Fall 2 in meinem Programm umzusetzen, bislang erfolglos. Sieht jemand eine Lösung? Ist das überhaupt so möglich?</p>
<p>Fall 1: Das funktioniert</p>
<p>(ADODataSet1 + DataSource1) -- DBLookupComboBox1<br />
(ADODataSet2 + DataSource2) -- DBLookupComboBox2<br />
(ADODataSet3 + DataSource3) -- DBLookupComboBox3</p>
<p>Fall 2: Kann das funktionieren? Wenn ja, wie?</p>
<p>(ADODataSet1 + DataSource1) \<br />
(ADODataSet2 + DataSource2) -- DBLookupComboBox1<br />
(ADODataSet3 + DataSource3) /</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/205595/sind-mehrere-datasources-datasets-für-ein-dbobjekt-möglich</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 19:51:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/205595.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Feb 2008 19:48:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sind mehrere DataSources, DataSets für ein DBObjekt möglich? on Fri, 15 Feb 2008 19:57:05 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich habe eine grundsätzlich Frage zu DataSource und DataSet. Ich versuche Fall 2 in meinem Programm umzusetzen, bislang erfolglos. Sieht jemand eine Lösung? Ist das überhaupt so möglich?</p>
<p>Fall 1: Das funktioniert</p>
<p>(ADODataSet1 + DataSource1) -- DBLookupComboBox1<br />
(ADODataSet2 + DataSource2) -- DBLookupComboBox2<br />
(ADODataSet3 + DataSource3) -- DBLookupComboBox3</p>
<p>Fall 2: Kann das funktionieren? Wenn ja, wie?</p>
<p>(ADODataSet1 + DataSource1) \<br />
(ADODataSet2 + DataSource2) -- DBLookupComboBox1<br />
(ADODataSet3 + DataSource3) /</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1456783</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1456783</guid><dc:creator><![CDATA[thunderbol4]]></dc:creator><pubDate>Fri, 15 Feb 2008 19:57:05 GMT</pubDate></item><item><title><![CDATA[Reply to Sind mehrere DataSources, DataSets für ein DBObjekt möglich? on Fri, 15 Feb 2008 21:17:32 GMT]]></title><description><![CDATA[<p>Du könntest<br />
-falls es sich um eine Query-Datenanfrage handelt, mit Unions diese drei datenquellen bei der Datenbankabfrage zusammenfassen</p>
<p>SELECT * FROM a<br />
UNION<br />
SELECT * FROM b</p>
<p>- oder Du kopierst die Datensätze der drei Quellen in eine vierte leere.</p>
<p>In beiden Fällen muss Du Dich aber um die Eindeutigkeit der Sätze kümmern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1456881</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1456881</guid><dc:creator><![CDATA[witte_]]></dc:creator><pubDate>Fri, 15 Feb 2008 21:17:32 GMT</pubDate></item><item><title><![CDATA[Reply to Sind mehrere DataSources, DataSets für ein DBObjekt möglich? on Sat, 16 Feb 2008 10:01:57 GMT]]></title><description><![CDATA[<p>Hallo @witte_,<br />
danke für Deinen Hinweis. Ich habe das nicht deutlich genug erklärt, worauf ich hinaus will:</p>
<p>Fall 1: Das funktioniert</p>
<p>(ADODataSet1 + DataSource1) -- DBLookupComboBox1<br />
(ADODataSet2 + DataSource2) -- DBLookupComboBox2<br />
(ADODataSet3 + DataSource3) -- DBLookupComboBox3</p>
<p>Fall 2: Kann das funktionieren? Wenn ja, wie?</p>
<p>..------&gt; ADODataSet1 + DataSource1 \<br />
..|<br />
xor ----&gt; ADODataSet2 + DataSource2 -- DBLookupComboBox1<br />
..|<br />
..------&gt; ADODataSet3 + DataSource3 /</p>
<p><strong>Die DBLookupComboBox1 wird beim Anklicken eines DBGrids über die angeklickte Zelle des DBGrids verschoben, wo sie dann in der DropDownliste die zulässigen Einträge anzeigen soll.<br />
Für jede Spalte des DBGrids wird deshalb eine eigene Abfrage benötigt, deren Ergebnis dann in der Dropdownliste der DBLookupComboBox angezeigt werden soll.<br />
Es soll nur eine DBLookupComboBox geben, die über alle Spalten des DBGrids verschoben werden kann.<br />
Ich muß also hier eine Zuweisung (=DataSet, DataSource) durchführen. Geht das?.</strong></p>
<p>Spalte1 Spalte2 Spalte3</p>
<p>...DBLookupComboBox1<br />
................xor<br />
..../.............|............\<br />
Zelle11 Zelle21 Zelle31<br />
Zelle12 Zelle22 Zelle32<br />
usw.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1456999</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1456999</guid><dc:creator><![CDATA[thunderbol4]]></dc:creator><pubDate>Sat, 16 Feb 2008 10:01:57 GMT</pubDate></item><item><title><![CDATA[Reply to Sind mehrere DataSources, DataSets für ein DBObjekt möglich? on Mon, 18 Feb 2008 00:20:58 GMT]]></title><description><![CDATA[<p>Immer noch kein Vorschlag? Ist das Problem so schwierig? Es müßte doch eine Antwort zu finden sein.<br />
Hier also noch ein Erklärungsversuch. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Progammaufbau:<br />
DBGrid1..........................DataSource1..ADODataSet1,<br />
TDBLookupComboBox1..DataSource2..ADODataSet2, ADODataSet3</p>
<p>Die TDBLookupComboBox wird beim Anklicken einer DBGrid-Zelle vor diese Zelle hinkopiert.</p>
<pre><code class="language-cpp">void __fastcall TForm1::Button1Click(TObject *Sender) {
[..]
//DBGrid1 besteht aus 2 Feldern: &quot;Name&quot; und  &quot;Ort&quot;
//Name bzw Ort sollen nur mit Daten aus &quot;einem&quot; Lookupfeld geändert/befüllt werden können.
  DataSource1-&gt;DataSet = ADODataSet1;  //Das DBGrid erhält d Datensätze einer SQL-Abfrage von ADODataSet1 aus Tabelle name_ort
  DBGrid1-&gt;DataSource = DataSource1; 

//Abfrage für Nachschlagefeld der DBLookupComboBox1 für das Feld &quot;Name&quot; aus der Tabelle name
  ADODataSet2-&gt;CommandType = cmdText;
  ADODataSet2-&gt;CommandText = &quot;SELECT * FROM name&quot;;
  ADODataSet2-&gt;Open();

//Abfrage aus der Tabelle ort für das Nachschlagefeld der DBLookupComboBox1 für das Feld &quot;Ort&quot; 
  ADODataSet3-&gt;CommandType = cmdText;
  ADODataSet3-&gt;CommandText = &quot;SELECT * FROM ort&quot;;
  ADODataSet3-&gt;Open();
[..]
//bis hier läuft alles bestens: Die DataSets enthalten die richtigen Datensätze, das DBGrid wird mit Name, Ort befüllt
}

void __fastcall TForm1::DBGrid1ColEnter(TObject *Sender) {
TDBGrid* dbG = dynamic_cast&lt;TDBGrid*&gt;(Sender);
  switch (dbG-&gt;SelectedIndex){
  case 0  : DataSource2-&gt;DataSet = ADODataSet2;  //Zuweisung DataSet für Feld &quot;Name&quot;  (Hier tritt die Exception auf)
            DBLookupComboBox1-&gt;DataSource = DataSource1;  //Verbindung zum DBGrid
            DBLookupComboBox1-&gt;ListSource = DataSource2;
            DBLookupComboBox1-&gt;DataField = &quot;Name&quot;;
            DBLookupComboBox1-&gt;KeyField = &quot;Name&quot;;  
            DBLookupComboBox1-&gt;ListField = &quot;Name&quot;; 
            break;
  case 1  : DataSource2-&gt;DataSet = ADODataSet3; //Zuweisung DataSet für Feld &quot;Ort&quot; (oder hier tritt die Exception auf)
            DBLookupComboBox1-&gt;DataSource = DataSource1; 
            DBLookupComboBox1-&gt;ListSource = DataSource2; 
            DBLookupComboBox1-&gt;DataField = &quot;Ort&quot;; 
            DBLookupComboBox1-&gt;KeyField = &quot;Ort&quot;;  
            DBLookupComboBox1-&gt;ListField = &quot;Ort&quot;; 
            break; 
  default : ;
  }; 
}
</code></pre>
<p>**Wenn ich im DBGrid beim Anklicken in der gleichen Spalte bleibe funktioniert die TDBLookupComboBox im Grid.<br />
Sobald ich zwischen den Spalten &quot;Name&quot; und &quot;Ort&quot; hin- u herklicke erhalte ich die Exception:<br />
..ist eine Exception der Klasse EDatabasError aufgetreten. Meldung: 'DBLookupComboBox1: Das Feld 'Name' bzw *'Ort' wurde nicht gefunden'..<br />
(*je nachdem was zuerst angeklickt wurde)</p>
<p>Weiß denn keiner, was ich hier falsch mache?** <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1457926</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1457926</guid><dc:creator><![CDATA[thunderbol4]]></dc:creator><pubDate>Mon, 18 Feb 2008 00:20:58 GMT</pubDate></item></channel></rss>