X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EA963DBC1D for ; Thu, 24 Nov 2005 13:48:01 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 73669-05 for ; Thu, 24 Nov 2005 17:48:00 +0000 (GMT) X-Greylist: delayed 00:43:24.535994 by SQLgrey- Received: from Mail2.KONTENT.De (mail2.kontent.de [81.88.34.59]) by svr1.postgresql.org (Postfix) with ESMTP id 78A55DBC0B for ; Thu, 24 Nov 2005 13:47:58 -0400 (AST) Received: from jedi.behrens.de (p5085B302.dip0.t-ipconnect.de [80.133.179.2]) by Mail2.KONTENT.De (Postfix) with ESMTP id 0BA873880BF for ; Thu, 24 Nov 2005 18:04:26 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by jedi.behrens.de (Postfix) with ESMTP id 4E8E422F70 for ; Thu, 24 Nov 2005 18:04:21 +0100 (CET) Received: from jedi.behrens.de ([127.0.0.1]) by localhost (jedi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22876-03 for ; Thu, 24 Nov 2005 18:04:21 +0100 (CET) Received: from anakin (anakin.behrens.de [192.168.150.240]) by jedi.behrens.de (Postfix) with ESMTP id 2DEDA22F6F for ; Thu, 24 Nov 2005 18:04:21 +0100 (CET) From: lothar.behrens@lollisoft.de To: pgsql-odbc@postgresql.org Date: Thu, 24 Nov 2005 18:04:20 +0100 MIME-Version: 1.0 Subject: Delete row (SQLSetPos) and then fetch over ? Message-ID: <438600A4.21217.1AB8D48@localhost> X-mailer: Pegasus Mail for Windows (4.21c, DE v4.21c R1a) Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: Quoted-printable Content-description: Mail message body X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.55 required=5 tests=[NO_REAL_NAME=0.55] X-Spam-Score: 0.55 X-Spam-Level: X-Archive-Number: 200511/208 X-Sequence-Number: 6444 Hi, I am struggling with deleting a row in my cursor. The scenaio is as follow= ing: I add some rows with empty data, some default columns and the like. Then I= check the contents by using the application to scroll over row by row. This work= s fine. Deleting the second last row let the GUI afterwards show the last row. Loo= ks ok as expected. But after going one row back (the deleted row), my application s= hows rubbish and may crash afterwards. How looks like correct ODBC code to detect the 'navigation' to the 'delete= d' row ? Thanks, Lothar My code looks like this: lbErrCodes LB_STDCALL lbQuery::previous() { UWORD RowStat[20]; UDWORD RowsFetched =3D 0; retcode =3D SQLExtendedFetch( hstmt, SQL_FETCH_PREV, 0, &RowsFetched, RowStat); if (retcode =3D=3D SQL_NO_DATA) { // Go back to valid row retcode =3D SQLExtendedFetch(hstmt, SQL_FETCH_NEXT, 0, &RowsFetched, RowStat); return ERR_DB_NODATA; } else { // Peek one row to detect if further scroll previous would be possible retcode =3D SQLExtendedFetch(hstmt, SQL_FETCH_PREV, 0, &RowsFetched, RowStat); if (retcode =3D=3D SQL_NO_DATA) { SQLExtendedFetch(hstmt, SQL_FETCH_NEXT, 0, &RowsFetched, RowStat); return WARN_DB_NODATA; } else { SQLExtendedFetch(hstmt, SQL_FETCH_NEXT, 0, &RowsFetched, RowStat); return ERR_NONE; } } -- Lothar Behrens | Rapid Prototyping ... Rosmarinstr 3 | 40235 D=FCsseldorf | www.lollisoft.de