CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Posts
    4

    Exclamation ODBC CRecordSet::PrepareAndExecute() cann't return

    Hi, everyone, i got a so unbelievable trouble, after 1 week, i still can't find why.

    The problem is :
    Platform:
    DataBase Server: windowAdSvr2k, Oracle 8.
    Client: windowsAdSvr 2k, VC6.0, VC-sp6.0, Oracle9i Client

    the DB contains a lot of data, which is indexed by its ID;

    My program uses Microsoft ODBC to query the DB.

    so there is a class derived from CRecordSet, using the default CRecordSet::Open() function.

    program works very well, but after a while , select data by a ID(eg, ID=2035),
    the program is DEAD!
    the DEAD means, by the sourcecode, I run the program step by step, run to CRecordSet::Open() ("/VC98/MFC/SRC/DBCORE.CPP"), then goto
    CRecordSet::PrepareAndExecute() ,
    In this funciton, the program run to Line 2481;
    AFX_ODBC_CALL(::SQLExecute(m_hstmt...);

    or Sometime run to Line 2420;
    AFX_ODBC_CALL(::SQLPrepare(m_hstmt....);

    the program is DEAD-LOCK! the MACRO cannot return , seems like in a dead loop. but now the CPU is not busy, just as usual .

    but if I use a cmd-line mode (use "sqlplus" to connect DB), query the same data-ID from DB , it works well.
    and in program, if I change another data-ID to select the DB, it work very well too !!!


    i am so confused !!!

    Is there any guy encountered this problem before???

    please help me!!

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: ODBC CRecordSet::PrepareAndExecute() cann't return

    Are you running a query that takes a long time to run perhaps? Returning a very large snapshot, looking for a value in an unindexed column?

  3. #3
    Join Date
    Dec 2005
    Posts
    4

    Re: ODBC CRecordSet::PrepareAndExecute() cann't return

    Quote Originally Posted by GCDEF
    Are you running a query that takes a long time to run perhaps? Returning a very large snapshot, looking for a value in an unindexed column?
    Thank you for your reply.

    the query does not take a long time to run.
    For example, the program goes dead-locked to query "ID=2035" data, but if I use cmd-mode, connect DB by "sqlplus" to query the same ID 's data, it returns very quickly and of course right results.

    so I wonder, the way between using "sqlplus" and the using Microsoft ODBC to query a DB, which differences are there ?
    the drivers ????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured