Delete row (SQLSetPos) and then fetch over ?

Поиск
Список
Период
Сортировка
От lothar.behrens@lollisoft.de
Тема Delete row (SQLSetPos) and then fetch over ?
Дата
Msg-id 438600A4.21217.1AB8D48@localhost
обсуждение исходный текст
Список pgsql-odbc
Hi,

I am struggling with deleting a row in my cursor. The scenaio is as following:

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 works fine.

Deleting the second last row let the GUI afterwards show the last row. Looks ok as
expected. But after going one row back (the deleted row), my application shows
rubbish and may crash afterwards.

How looks like correct ODBC code to detect the 'navigation' to the 'deleted' row ?

Thanks, Lothar

My code looks like this:

lbErrCodes LB_STDCALL lbQuery::previous() {
        UWORD   RowStat[20];
        UDWORD  RowsFetched = 0;

        retcode = SQLExtendedFetch(    hstmt,
                    SQL_FETCH_PREV,
                    0, &RowsFetched, RowStat);

        if (retcode == SQL_NO_DATA) {
    // Go back to valid row
    retcode = 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 =
    SQLExtendedFetch(hstmt, SQL_FETCH_PREV, 0, &RowsFetched,
RowStat);
    if (retcode == 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üsseldorf      |    www.lollisoft.de




В списке pgsql-odbc по дате отправления:

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: Continuing encoding fun....
Следующее
От: "lothar.behrens@lollisoft.de"
Дата:
Сообщение: VARCHAR, CHAR types changed ?