Home > Archive > MS SQL Server ODBC > August 2005 > app hangs after ODBC API call









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author app hangs after ODBC API call
baraklo@gmail.com

2005-08-05, 8:23 pm

Our app that uses MFC ODBC classes(CDATABASE, CRECORDSET) often hangs
after the folllowing sequence:

- open connection
- connection to DB lost due to network problems
- close connection
- open connection
- open recordset

App hangs in CRecordset::PrepareA
ndExecute() while executing
SQLExecDirect

Anybody experienced anything like that? Maybe DB disconnects are
supposed to be handled differently?

Matt Neerincx [MS]

2005-08-22, 3:23 am

No, that is the right way to do it. It should not hang. You can run into
strange problems with ODBC drivers if you are not very careful with ODBC
handles (like HDBC and HSTMT). The CRecordset and CDatabase classes are
wrapper classes for HSTMT and HDBC.

One KEY thing is this. If you close a CDatabase then all child CRecordset
objects are immediately invalidated, attempting to close these could cause
some handle problems (I'm not totally sure because I have not used these
classes in 3-4 years, but I seem to recall this issue).

Matt Neerincx [MSFT]

This posting is provided "AS IS", with no warranties, and confers no rights.

Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

<baraklo@gmail.com> wrote in message
news:1123267601.348471.244820@z14g2000cwz.googlegroups.com...
> Our app that uses MFC ODBC classes(CDATABASE, CRECORDSET) often hangs
> after the folllowing sequence:
>
> - open connection
> - connection to DB lost due to network problems
> - close connection
> - open connection
> - open recordset
>
> App hangs in CRecordset::PrepareA
ndExecute() while executing
> SQLExecDirect
>
> Anybody experienced anything like that? Maybe DB disconnects are
> supposed to be handled differently?
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com