<?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[MySQLdac - Probleme mit nem SQL]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich lese mit meiner C++ Anwendung eine Datei ein, werte die Aus und schreibe Informationen in eine MySQL Datenbank:</p>
<pre><code class="language-cpp">String sql = &quot;INSERT INTO products (titel, sprache)VALUES ('&quot;+dbtitel+&quot;', '&quot;+dbsprache+&quot;');&quot;;

try
   {
      Form1-&gt;SQLQuery-&gt;Close();
      Form1-&gt;SQLQuery-&gt;SQL-&gt;Clear();
      Form1-&gt;SQLQuery-&gt;SQL-&gt;Add(sql);
      Form1-&gt;SQLQuery-&gt;ExecSQL();
      return true;
   }
   catch(...)
   {
      //Form1-&gt;Memo1-&gt;Clear();
      //Form1-&gt;Memo1-&gt;Lines-&gt;Add(sql);
      return false;
   }
</code></pre>
<p>Ein SQL Der Probleme macht sieht so aus:</p>
<pre><code>INSERT INTO products (titel, sprache)VALUES ('&amp;quot; I'm Sorry I Haven't a Clue', 'eng');
</code></pre>
<p>Problem ist klar, es liegt an dem '. Sicherlich werden andere Sonderzeichen auch noch Probleme machen. Gibst ne möglichkeit, all diese Zeichen Problemlos in die Datenbank zu schreiben?<br />
Kann ein PHP Script diese Zeichen später ohne Probleme auch wieder lesen?</p>
<p>Dirk</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/95569/mysqldac-probleme-mit-nem-sql</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 23:48:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/95569.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Dec 2004 10:08:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MySQLdac - Probleme mit nem SQL on Tue, 21 Dec 2004 10:08:49 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich lese mit meiner C++ Anwendung eine Datei ein, werte die Aus und schreibe Informationen in eine MySQL Datenbank:</p>
<pre><code class="language-cpp">String sql = &quot;INSERT INTO products (titel, sprache)VALUES ('&quot;+dbtitel+&quot;', '&quot;+dbsprache+&quot;');&quot;;

try
   {
      Form1-&gt;SQLQuery-&gt;Close();
      Form1-&gt;SQLQuery-&gt;SQL-&gt;Clear();
      Form1-&gt;SQLQuery-&gt;SQL-&gt;Add(sql);
      Form1-&gt;SQLQuery-&gt;ExecSQL();
      return true;
   }
   catch(...)
   {
      //Form1-&gt;Memo1-&gt;Clear();
      //Form1-&gt;Memo1-&gt;Lines-&gt;Add(sql);
      return false;
   }
</code></pre>
<p>Ein SQL Der Probleme macht sieht so aus:</p>
<pre><code>INSERT INTO products (titel, sprache)VALUES ('&amp;quot; I'm Sorry I Haven't a Clue', 'eng');
</code></pre>
<p>Problem ist klar, es liegt an dem '. Sicherlich werden andere Sonderzeichen auch noch Probleme machen. Gibst ne möglichkeit, all diese Zeichen Problemlos in die Datenbank zu schreiben?<br />
Kann ein PHP Script diese Zeichen später ohne Probleme auch wieder lesen?</p>
<p>Dirk</p>
]]></description><link>https://www.c-plusplus.net/forum/post/677785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677785</guid><dc:creator><![CDATA[Dirk K.]]></dc:creator><pubDate>Tue, 21 Dec 2004 10:08:49 GMT</pubDate></item><item><title><![CDATA[Reply to MySQLdac - Probleme mit nem SQL on Tue, 21 Dec 2004 11:14:50 GMT]]></title><description><![CDATA[<pre><code>INSERT INTO products (titel, sprache)VALUES ('&amp;quot; I\'m Sorry I Haven\'t a Clue', 'eng');
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/677816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677816</guid><dc:creator><![CDATA[barcoder]]></dc:creator><pubDate>Tue, 21 Dec 2004 11:14:50 GMT</pubDate></item><item><title><![CDATA[Reply to MySQLdac - Probleme mit nem SQL on Tue, 21 Dec 2004 11:16:42 GMT]]></title><description><![CDATA[<p>Du könntest parametrisierte Statements verwenden, z.B.:</p>
<pre><code class="language-cpp">String sql = &quot;INSERT INTO products (titel, sprache)VALUES (':dbtitel', ':dbsprache');&quot;;

try
   {
      Form1-&gt;SQLQuery-&gt;Close();
      Form1-&gt;SQLQuery-&gt;SQL-&gt;Clear();
      Form1-&gt;SQLQuery-&gt;SQL-&gt;Add(sql);
      Form1-&gt;SQLQuery-&gt;Prepare();
      Form1-&gt;SQLQuery-&gt;ParamByName(&quot;dbtitel&quot;)-&gt;AsString = dbtitel;
      Form1-&gt;SQLQuery-&gt;ParamByName(&quot;dbsprache&quot;)-&gt;AsString = dbsprache;
      Form1-&gt;SQLQuery-&gt;ExecSQL();
      return true;
   }
   catch(...)
   {
      //Form1-&gt;Memo1-&gt;Clear();
      //Form1-&gt;Memo1-&gt;Lines-&gt;Add(sql);
      return false;
   }
</code></pre>
<p>Die andere Möglichkeit ist, sich selbst darum zu kümmern. Hilfreich könnte dabei die Methode QuotedStr() sein.<br />
Was PHP damit anstellt, weiß ich aber nicht.</p>
<p>Gruß,</p>
<p>Alexander</p>
]]></description><link>https://www.c-plusplus.net/forum/post/677818</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677818</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Tue, 21 Dec 2004 11:16:42 GMT</pubDate></item><item><title><![CDATA[Reply to MySQLdac - Probleme mit nem SQL on Tue, 21 Dec 2004 11:16:55 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe dies hier probiert:</p>
<p>sql= StringReplace(sql, &quot;'&quot;, &quot;\'&quot;, TReplaceFlags() &lt;&lt; rfReplaceAll);</p>
<p>Aber das funktioniert auch nicht. Irgendwie muss es aber gehen, jemand eine Idee?</p>
<p>Dirk</p>
]]></description><link>https://www.c-plusplus.net/forum/post/677819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677819</guid><dc:creator><![CDATA[Dirk K.]]></dc:creator><pubDate>Tue, 21 Dec 2004 11:16:55 GMT</pubDate></item><item><title><![CDATA[Reply to MySQLdac - Probleme mit nem SQL on Tue, 21 Dec 2004 11:21:06 GMT]]></title><description><![CDATA[<p>Wenn schon StringReplace() dann</p>
<pre><code class="language-cpp">sql= StringReplace(sql, &quot;'&quot;, &quot;''&quot;, TReplaceFlags() &lt;&lt; rfReplaceAll); // Verdopplung der Hochkommas
</code></pre>
<p>Gruß,</p>
<p>Alexander</p>
]]></description><link>https://www.c-plusplus.net/forum/post/677821</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/677821</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Tue, 21 Dec 2004 11:21:06 GMT</pubDate></item></channel></rss>