<?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[Brauche Bitte mal hilfe bei SQL Insert]]></title><description><![CDATA[<p>Hallo<br />
Ich komme einfach nicht weiter in meiner testanwendung.<br />
Ich Schreibe eine db mit Save. Del. New u.s.w.<br />
das Save + del geht aber Insert für neue ID bekomme ich nicht hin.</p>
<pre><code class="language-cpp">void CHKPV2008Dlg::OnBntNew() 
{
int iCurrIndex;	

 CUser* pUser = NULL;
 ASSERT(pUser);
   UpdateData();

   CString strPrevARTIKELID;
   strPrevARTIKELID = m_strARTIKELID;

   CString strPrevARTIKELNAME;
   strPrevARTIKELNAME = m_strARTIKELNAME;

   CString strPrevARTIKELGROESSE;
   strPrevARTIKELGROESSE = m_strARTIKELGROESSE;

   CString strPrevARTIKELNUMMER;
   strPrevARTIKELNUMMER = m_strARTIKELNUMMER;

   CString strPrevARTIKELBESTAND;
   strPrevARTIKELBESTAND.Format(&quot;%d&quot;,m_iARTIKELBESTAND);

   CString strPrevARTIKELSOLL;
   strPrevARTIKELSOLL.Format(&quot;%d&quot;,m_iARTIKELSOLL);

   pUser-&gt;m_strARTIKELID = m_strARTIKELID;
   pUser-&gt;m_strARTIKELNAME = m_strARTIKELNAME;
   pUser-&gt;m_strARTIKELGROESSE = m_strARTIKELGROESSE;
   pUser-&gt;m_strARTIKELNUMMER = m_strARTIKELNUMMER;
   pUser-&gt;m_iARTIKELSOLL = m_iARTIKELSOLL;
   pUser-&gt;m_iARTIKELBESTAND = m_iARTIKELBESTAND;
   InitControls();

    UpdateData(FALSE);
}

BOOL CHKPV2008Dlg::InsertUser(CUser *pUser)
{
 BOOL bSuccess = FALSE;
 CDatabase db;

 try
 {
  if (db.Open(&quot;HKPV&quot;))// Datenbank Name 
  {
   CString strSQL;
   strSQL.Format(&quot;INSERT HKPV SET sArtikelNAME='%s', sArtikelNUMMER='%s', sArtikelGROESSE='%s', iArtikelSOLL=%d, iArtikelBESTAND=%d WHERE sArtikelID=%s;&quot;,
			pUser-&gt;m_strARTIKELNAME, pUser-&gt;m_strARTIKELNUMMER, pUser-&gt;m_strARTIKELGROESSE,pUser-&gt;m_iARTIKELSOLL, pUser-&gt;m_iARTIKELBESTAND, pUser-&gt;m_strARTIKELID);

   db.ExecuteSQL(strSQL);

   bSuccess = TRUE;
  }
 }
 catch(CDBException* pe)
 {
  AfxMessageBox(pe-&gt;m_strError);			

  if (db.IsOpen())
  {
   db.Close();
  }

  pe-&gt;Delete();
 }

 return bSuccess;

}
</code></pre>
<p>Wo liegt mein fehler?<br />
Auch suche ich die Möglichkeit wie man in DB List1 eine alphabetische Sortierung zu bekommen ( ausgabe LIST1)<br />
danke für Hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/203146/brauche-bitte-mal-hilfe-bei-sql-insert</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Apr 2026 22:02:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/203146.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Jan 2008 12:27:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Brauche Bitte mal hilfe bei SQL Insert on Sat, 19 Jan 2008 12:27:56 GMT]]></title><description><![CDATA[<p>Hallo<br />
Ich komme einfach nicht weiter in meiner testanwendung.<br />
Ich Schreibe eine db mit Save. Del. New u.s.w.<br />
das Save + del geht aber Insert für neue ID bekomme ich nicht hin.</p>
<pre><code class="language-cpp">void CHKPV2008Dlg::OnBntNew() 
{
int iCurrIndex;	

 CUser* pUser = NULL;
 ASSERT(pUser);
   UpdateData();

   CString strPrevARTIKELID;
   strPrevARTIKELID = m_strARTIKELID;

   CString strPrevARTIKELNAME;
   strPrevARTIKELNAME = m_strARTIKELNAME;

   CString strPrevARTIKELGROESSE;
   strPrevARTIKELGROESSE = m_strARTIKELGROESSE;

   CString strPrevARTIKELNUMMER;
   strPrevARTIKELNUMMER = m_strARTIKELNUMMER;

   CString strPrevARTIKELBESTAND;
   strPrevARTIKELBESTAND.Format(&quot;%d&quot;,m_iARTIKELBESTAND);

   CString strPrevARTIKELSOLL;
   strPrevARTIKELSOLL.Format(&quot;%d&quot;,m_iARTIKELSOLL);

   pUser-&gt;m_strARTIKELID = m_strARTIKELID;
   pUser-&gt;m_strARTIKELNAME = m_strARTIKELNAME;
   pUser-&gt;m_strARTIKELGROESSE = m_strARTIKELGROESSE;
   pUser-&gt;m_strARTIKELNUMMER = m_strARTIKELNUMMER;
   pUser-&gt;m_iARTIKELSOLL = m_iARTIKELSOLL;
   pUser-&gt;m_iARTIKELBESTAND = m_iARTIKELBESTAND;
   InitControls();

    UpdateData(FALSE);
}

BOOL CHKPV2008Dlg::InsertUser(CUser *pUser)
{
 BOOL bSuccess = FALSE;
 CDatabase db;

 try
 {
  if (db.Open(&quot;HKPV&quot;))// Datenbank Name 
  {
   CString strSQL;
   strSQL.Format(&quot;INSERT HKPV SET sArtikelNAME='%s', sArtikelNUMMER='%s', sArtikelGROESSE='%s', iArtikelSOLL=%d, iArtikelBESTAND=%d WHERE sArtikelID=%s;&quot;,
			pUser-&gt;m_strARTIKELNAME, pUser-&gt;m_strARTIKELNUMMER, pUser-&gt;m_strARTIKELGROESSE,pUser-&gt;m_iARTIKELSOLL, pUser-&gt;m_iARTIKELBESTAND, pUser-&gt;m_strARTIKELID);

   db.ExecuteSQL(strSQL);

   bSuccess = TRUE;
  }
 }
 catch(CDBException* pe)
 {
  AfxMessageBox(pe-&gt;m_strError);			

  if (db.IsOpen())
  {
   db.Close();
  }

  pe-&gt;Delete();
 }

 return bSuccess;

}
</code></pre>
<p>Wo liegt mein fehler?<br />
Auch suche ich die Möglichkeit wie man in DB List1 eine alphabetische Sortierung zu bekommen ( ausgabe LIST1)<br />
danke für Hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1439409</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1439409</guid><dc:creator><![CDATA[cooper3210]]></dc:creator><pubDate>Sat, 19 Jan 2008 12:27:56 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Bitte mal hilfe bei SQL Insert on Sat, 19 Jan 2008 18:56:45 GMT]]></title><description><![CDATA[<p>Dein INSERT Statement ist vollkommener Quatsch.</p>
<pre><code>INSERT tablename (feld1, feld2, feld3) VALUES (value1, value2, value3)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1439604</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1439604</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sat, 19 Jan 2008 18:56:45 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Bitte mal hilfe bei SQL Insert on Sat, 19 Jan 2008 19:39:02 GMT]]></title><description><![CDATA[<p>Zudem eine nette offene Tür für SQL-Injection... Da läuft es mit eiskalt den Rücken runter wenn ich solche Ansätze sehe um SQL Statement zu bauen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1439621</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1439621</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 19 Jan 2008 19:39:02 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Bitte mal hilfe bei SQL Insert on Sun, 20 Jan 2008 12:53:39 GMT]]></title><description><![CDATA[<p>Hi<br />
Hätte ich gewusst wie es geht, müsste ich nicht fragen oder?<br />
Aber ich habe es schon zum laufen bekommen DANKE EUCH ABER<br />
mfg cooper</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1439871</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1439871</guid><dc:creator><![CDATA[cooper3210]]></dc:creator><pubDate>Sun, 20 Jan 2008 12:53:39 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Bitte mal hilfe bei SQL Insert on Sun, 20 Jan 2008 13:06:44 GMT]]></title><description><![CDATA[<p>Dieses Statement läuft auf MySQL so. Es wird dort akzeptiert.<br />
Dies ist aber RDBMS abhängig.<br />
Für alle ist es so gültig wie es hustbaer geschrieben hat.<br />
Nur zur Erklärung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1439876</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1439876</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Sun, 20 Jan 2008 13:06:44 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Bitte mal hilfe bei SQL Insert on Sun, 20 Jan 2008 19:34:24 GMT]]></title><description><![CDATA[<p>Unix-Tom schrieb:</p>
<blockquote>
<p>Dieses Statement läuft auf MySQL so. Es wird dort akzeptiert.</p>
</blockquote>
<p>Also das &quot;INSERT x SET a = b, c = d&quot; kann ich mir noch vorstellen, aber was soll der &quot;WHERE e = f&quot; Teil hinten? Was soll der bei einem INSERT bewirken?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440133</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440133</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 20 Jan 2008 19:34:24 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Bitte mal hilfe bei SQL Insert on Sun, 20 Jan 2008 19:49:22 GMT]]></title><description><![CDATA[<p>dann ersetze mal INSERT mit UPDATE und Du weist woher das ganze kommt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440141</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440141</guid><dc:creator><![CDATA[Gast xxx]]></dc:creator><pubDate>Sun, 20 Jan 2008 19:49:22 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Bitte mal hilfe bei SQL Insert on Sun, 20 Jan 2008 20:06:41 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/15778">@Gast</a> xxx<br />
Danke das ist mir auch klar <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>Unix-Tom hat aber geschrieben dass MySQL das Statement so akzeptiert, und ich kann mir wirklich nicht vorstellen dass MySQL ein INSERT mit einer WHERE clause akzeptiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440157</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440157</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 20 Jan 2008 20:06:41 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Bitte mal hilfe bei SQL Insert on Mon, 21 Jan 2008 13:28:04 GMT]]></title><description><![CDATA[<p>Nein geht auch in MySQL nicht. Das Where habe ich auch übersehen.<br />
Dachte es kommt hier auf das SET an welchen von MySQl genommen wird.<br />
Man sollte aber trotzdem beim Standard bleiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440585</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440585</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Mon, 21 Jan 2008 13:28:04 GMT</pubDate></item></channel></rss>