<?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[SQLExecDirect liefert -1 zurück]]></title><description><![CDATA[<p>Wie schon im Titel beschrieben wenn ich die folgende Anweisung ausführe bekomme -1 als rückgabewert.</p>
<pre><code>retcode = SQLExecDirect(hstmt, (SQLCHAR*) cTemp, SQL_NTS);
</code></pre>
<p>Hab in der MSDN nachgeschaut aber hab nichts über negative Werte gefunden kann mir jemand von euch eventuell sagen was das zu bedeuten hat bzw. was ich Falsch mache?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/157654/sqlexecdirect-liefert-1-zurück</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Jul 2026 23:09:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/157654.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Aug 2006 11:08:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SQLExecDirect liefert -1 zurück on Mon, 28 Aug 2006 11:08:58 GMT]]></title><description><![CDATA[<p>Wie schon im Titel beschrieben wenn ich die folgende Anweisung ausführe bekomme -1 als rückgabewert.</p>
<pre><code>retcode = SQLExecDirect(hstmt, (SQLCHAR*) cTemp, SQL_NTS);
</code></pre>
<p>Hab in der MSDN nachgeschaut aber hab nichts über negative Werte gefunden kann mir jemand von euch eventuell sagen was das zu bedeuten hat bzw. was ich Falsch mache?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126036</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126036</guid><dc:creator><![CDATA[Klausii]]></dc:creator><pubDate>Mon, 28 Aug 2006 11:08:58 GMT</pubDate></item><item><title><![CDATA[Reply to SQLExecDirect liefert -1 zurück on Mon, 28 Aug 2006 11:45:34 GMT]]></title><description><![CDATA[<p>Aus sql.h:</p>
<pre><code class="language-cpp">#define SQL_SUCCESS                0
#define SQL_SUCCESS_WITH_INFO      1
#if (ODBCVER &gt;= 0x0300)
#define SQL_NO_DATA              100
#endif
#define SQL_ERROR                 (-1)
#define SQL_INVALID_HANDLE        (-2)

#define SQL_STILL_EXECUTING        2
#define SQL_NEED_DATA             99
</code></pre>
<p>Da hast du deine -1 <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126060</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126060</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 28 Aug 2006 11:45:34 GMT</pubDate></item><item><title><![CDATA[Reply to SQLExecDirect liefert -1 zurück on Mon, 28 Aug 2006 12:07:19 GMT]]></title><description><![CDATA[<p>Ohja hab ich ganz übersehen jetzt frag ich mich nur wo da mein Fehler ist? Die SQL Anweisung selbst läuft im Queryanalyzer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126081</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126081</guid><dc:creator><![CDATA[Klausii]]></dc:creator><pubDate>Mon, 28 Aug 2006 12:07:19 GMT</pubDate></item><item><title><![CDATA[Reply to SQLExecDirect liefert -1 zurück on Mon, 28 Aug 2006 12:10:12 GMT]]></title><description><![CDATA[<p>Klausii schrieb:</p>
<blockquote>
<p>Ohja hab ich ganz übersehen jetzt frag ich mich nur wo da mein Fehler ist?</p>
</blockquote>
<p>Tja, da du das Statement hier nicht zeigst, wird dir das nur jemand mit hellseherischen Fähigkeiten beantworten können.</p>
<p>In der MSDN Library steht im Eintrag zu SQLExecDirect aber auch, wie du an weitere Fehlerinformationen kommst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126084</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126084</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 28 Aug 2006 12:10:12 GMT</pubDate></item><item><title><![CDATA[Reply to SQLExecDirect liefert -1 zurück on Mon, 28 Aug 2006 12:40:45 GMT]]></title><description><![CDATA[<p>Okay hier mal der Code</p>
<pre><code>strSQL  = _T( &quot;SELECT PRUEFUNGEN.MASCHINENNR &quot;                                );
      strSQL += _T( &quot;FROM ( &quot;                                                       );
      strSQL += _T( &quot;       ( &quot;                                                     );
      strSQL += _T( &quot;         ( &quot;                                                   );
      strSQL += _T( &quot;           PRUEFUNGEN INNER JOIN PRUEFFEHLER ON &quot;              );
      strSQL += _T( &quot;             PRUEFUNGEN.PRUEFNR = PRUEFFEHLER.PRUEFNR &quot;        );
      strSQL += _T( &quot;         ) INNER JOIN PLAETZE ON &quot;                             );
      strSQL += _T( &quot;             PRUEFUNGEN.PLATZ = PLAETZE.BEZEICHNER &quot;           );
      strSQL += _T( &quot;       ) INNER JOIN STAMMDATEN ON &quot;                            ); 
      strSQL += _T( &quot;           PRUEFUNGEN.MASCHINENNR = STAMMDATEN.MASCHINENNR &quot;   );
      strSQL += _T( &quot;       LEFT JOIN NACHARBEIT ON &quot;                               );
      strSQL += _T( &quot;         PRUEFUNGEN.MASCHINENNR = NACHARBEIT.MASCHINENNR &quot;     );
      strSQL += _T( &quot;WHERE ( &quot;                                                      );
      strSQL += _T( &quot;        ((PRUEFFEHLER.FEHLERSTATUS)&lt;4) AND &quot;                   );
      strSQL += _T( &quot;        ((PLAETZE.LETZTERPLATZ)=1) AND &quot;                       );
      strSQL += _T( &quot;        ((STAMMDATEN.LETZTERMASCHINENSTATUS)&lt;&gt;'9') AND &quot;       );
      strSQL += _T( &quot;        ((PRUEFUNGEN.STATUS)&lt;0) AND &quot;                          );
      strSQL += _T( &quot;        ((NACHARBEIT.MASCHINENNR) Is Null) &quot;                   );
      strSQL += _T( &quot;      ) &quot;                                                      );
      strSQL += _T( &quot;GROUP BY PRUEFUNGEN.MASCHINENNR&quot;                              );

  n = WideCharToMultiByte(CP_ACP,0,(LPCWSTR) strSQL, strSQL.GetLength(), cTemp, 2048, 0, 0);
  cTemp[n] = 0;

  retcode = SQLExecDirect(hstmt, (SQLCHAR*) cTemp, SQL_NTS);

  ODBCConnect.SetModus(FALSE);

  if (retcode == SQL_SUCCESS)
  {
    while (FALSE == bEOF)
    {
     retcode = SQLFetch(hstmt);

     if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
     {
       if (FALSE == bNew)
       {
          ODBCConnect.GetDataLong   (hstmt, structNacharbeit.lListposition,       1);
          ODBCConnect.GetDataString (hstmt, structNacharbeit.strMaschinenNr, 100, 2);
          ODBCConnect.GetDataString (hstmt, structNacharbeit.strStandort,    50,  3);

					ODBCConnect.GetDataDate (hstmt, structNacharbeit.tmBeginnDatum,  4);

       }
       else
       {
        lStartID ++;
        structNacharbeit.lListposition = lStartID;
        ODBCConnect.GetDataString (hstmt, structNacharbeit.strMaschinenNr, 100, 1);
        //structNacharbeit.strStandort = &quot;(neuer Standort)&quot;;
        structNacharbeit.strStandort = NEUER_STANDORT;

				structNacharbeit.tmBeginnDatum.SetDate(INIT_YEAR,INIT_MONTH,INIT_DAY);
				for (int i =0;i&lt;= pArrStammdat-&gt;GetUpperBound();i++)
				{
					if (pArrStammdat-&gt;GetAt(i).strMaschinenNr == structNacharbeit.strMaschinenNr)
					{
						structNacharbeit.tmBeginnDatum = pArrStammdat-&gt;GetAt(i).tmBeginnDatum;
						break;
					}
				}

       }//end if (FALSE == bNew)

       pArrNacharbeit-&gt;Add(structNacharbeit);
     } // if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
     else
     {
       bEOF = TRUE;  //EOF erreicht
     } //if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) else
    } // while (FALSE = bEOF)
  } // if (retcode == SQL_SUCCESS)
  else
  {
    AfxMessageBox (_T(&quot;Error ODBC-Connect (NACHARBEIT)&quot;));
  }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1126115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126115</guid><dc:creator><![CDATA[klausi]]></dc:creator><pubDate>Mon, 28 Aug 2006 12:40:45 GMT</pubDate></item><item><title><![CDATA[Reply to SQLExecDirect liefert -1 zurück on Mon, 28 Aug 2006 12:56:22 GMT]]></title><description><![CDATA[<p>Ist ja keine einfache Abfrage mit den ganzen INNER JOIN usw.. Du könntest ja mal ausprobieren, ob es mit einer einfachen SELECT-Abfrage funktioniert. Wenn ja, dann ist der Code schon mal richtig. Dann könntest du ein JOIN nach dem anderen wieder rein nehmen um festzustellen, wo er nicht mehr mitmacht. Vielleicht ist das einfach zu komplex, sodass ein Timeout o.ä. dazwischen haut. Da könnte dann wieder ein SetQueryTimeout(...) helfen.<br />
Eine andere Sache sind die ganzen Formatierungen (Leerzeichen) in der SQL-Anweisung. Muss kein Fehler verursachen, könnte aber...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126131</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126131</guid><dc:creator><![CDATA[isabeau]]></dc:creator><pubDate>Mon, 28 Aug 2006 12:56:22 GMT</pubDate></item></channel></rss>