MFC -> CDBException

Discussion in 'C++' started by Diogo Moreno, Sep 9, 2003.

  1. Diogo Moreno

    Diogo Moreno Guest

    hi there...
    When try to delete a record, CRecordset throws a
    AFX_SQL_ERROR_NO_CURRENT_RECORD exception... Anybody knows what it
    means? My sql query is right...

    Ex.:
    CRecordset m_reg;
    m_reg.m_strFilter = "ID_NET=0 AND ID_CASE=107 AND NAME='gr' AND
    PT_PTO='Line AC 1 3 1'";
    m_reg.Delete(); //exception

    TIA!
     
    Diogo Moreno, Sep 9, 2003
    #1
    1. Advertising

  2. Diogo Moreno

    Howard Guest

    "Diogo Moreno" <> wrote in message
    news:...
    > hi there...
    > When try to delete a record, CRecordset throws a
    > AFX_SQL_ERROR_NO_CURRENT_RECORD exception... Anybody knows what it
    > means? My sql query is right...
    >
    > Ex.:
    > CRecordset m_reg;
    > m_reg.m_strFilter = "ID_NET=0 AND ID_CASE=107 AND NAME='gr' AND
    > PT_PTO='Line AC 1 3 1'";
    > m_reg.Delete(); //exception
    >
    > TIA!


    Looks like it means that there are no records when that filter is applied.
    You may have to put that Delete in a try..except block to catch exceptions
    like this. But you'd better ask this in a microsoft newsgroup, preferable
    one dealing with sql. It's pretty far off-topic here.
    -Howard
     
    Howard, Sep 9, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ss

    mslu for VC7 with static MFC

    ss, Jul 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,003
  2. Tarundeep Singh Kalra

    VC++ MFC and .NET

    Tarundeep Singh Kalra, Jan 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,602
    Gaurav Khanna [C#/.NET MVP]
    Jan 23, 2004
  3. Scott McPhillips
    Replies:
    0
    Views:
    401
    Scott McPhillips
    Jul 5, 2003
  4. ringos75
    Replies:
    0
    Views:
    1,000
    ringos75
    Apr 14, 2005
  5. yopwojtek

    Derive from MFC DLL to MFC APP

    yopwojtek, Aug 6, 2005, in forum: C++
    Replies:
    1
    Views:
    404
    Alf P. Steinbach
    Aug 6, 2005
Loading...

Share This Page