Strange Problem when closing the database object

Hi All,
I have a COM component using which is interacting with the database
using the CDAODATABASE class. my applications works fine when i built
it with VS6. when i built the application with VS2005, the application
is suddently unloaded when  i am trying to close the database.

my database object is
CDaoDatabase  *m_DB;

when my application calls the following method the component is
getting unloaded.
STDMETHODIMP CFeatureTable::Close()
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState())
        HRESULT hRes = S_OK;
    if (!m_Initialized)
        return S_OK;

    TRY_DAO
    {
        // Need to rollback the current transaction to prevent
        // nested transactions (limited to 5 for a workspace).
        if (m_TransactionOpen && m_DB->m_pWorkspace->IsOpen())
        {
            m_DB->m_pWorkspace->Rollback();
            m_TransactionOpen = FALSE;
            m_DB->m_pWorkspace->Close();
        }

        // Update everything first.
        m_pFeature->Close();

        if (m_CategoryRec->IsOpen())
        {
            if (m_CategoryRec->GetEditMode() != dbEditNone)
                m_CategoryRec->Update();
            m_CategoryRec->Close();
        }

        if (m_DB->IsOpen())
            m_DB->Close(); /* i am getting the problem at this line.*/

          }

    CATCH_DAO_EXCEPTION;

    delete m_TmpFeatureRec;
    delete m_TmpFeatureExRec;
    delete m_MSCatalogRec;
    delete m_CategoryRec;
    delete m_DB;
    m_TmpFeatureRec = NULL;
    m_TmpFeatureExRec = NULL;
    m_MSCatalogRec = NULL;
    m_CategoryRec = NULL;
    m_DB = NULL;


    return hRes;
}


I am gettting the problem at the following line
 if (m_DB->IsOpen())
            m_DB->Close();
i found this is occuring only in release mode. In debug mode the
application is working fine.
The surprising part is the application is working fine in debug mode
when built in VS6 and VS2005. It is giving problem only when it is
built in release mode in  VS2005.

Can any one give me some suggestions to resolve this issue?

Thanks in advance,
suneel

0
5/16/2007 4:48:58 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
271 Views

Similar Articles

[PageSpeed] 30

Reply:

Similar Artilces:

Exchange problems after reboot
Hello! I'm having trouble with Exchange 2003 (Ex2003 SP2 running on Windows Server 2003 SP). Every time after reboot Exchange don't start correctly. I have a "8231 MSExchangeAL" and "8247 MSExchangeAL" errors in application log. Also the Exchange Information Store fails during startup and the Exchante MTA Stacks too. After reboot when I log on to server I can start those two services manualy and everything runs fine, so I'm little (or much) confused. I didn't have problems with reboots before. I have checked KB 27529, KB 286356 and few others and ...

Printer problem when OPENING reports
Access 2002. Opening a database from another user's machine, and when trying to open up a report, a dlg comes up saying that the printer doesn't exist. The printer it lists, is the one that I was hooked up to on my machine when I last printed the report. The person has his own printer, why wouldn't it just print to that printer. I don't have any code or settings that I know of that have made the report do that. That seems like me sending a word doc, and when you open it up, it says MY printer is not available. Of course not, you'd be printing it on YOUR printer....

PC Charge Problem
We have been having a problem with double charging in some instances. We swipe the card and the PC Charge processing screen gets hung up waiting. Sometimes it cancels itself, sometimes it takes a while and we need to cancel it. We then reswipe and it goes through. What ends up happening is that sometimes the first swipe ends up getting charged to the customers account, but does not get registered as a sale on RMS (the second swipe does). Then, once the customer gets their bill and notices the double charge, I need to refund the card, and this gets relected in my sales on RMS. Has ...

All my databases now expect a password
Hi I have set up a database for a client that required restricted access, with the use of user names & passwords. For this, I created a dedicated work group file and set it up that way. Everything has been working fine, including the customers copy. Now, I have come to make some changes to it - including splitting the database into a front end and a back end. Now, all the databases on my PC are asking me for a user name & password - it was only intended for the one. What has happened here & how can I put it right? Stapes On Aug 28, 7:47 am, Stapes <steve.sta...@gmail.com>...

Matrix Problem
I was trying to match a matrix division, that was written in another code. Matrix A = 1 1 1 1 0 0 0 0 1000 100 10 1 0 0 0 0 0 0 0 0 1000 100 10 1 0 0 0 0 4096 256 16 1 3 2 1 0 0 0 0 0 300 20 1 0 -300 -20 -1 0 0 0 0 0 768 32 1 0 60 2 0 0 -60 -2 0 0 Matrix B = 0.11413125 0.30555 0.30555 0.425 0.0085625 0 0.019908333 0 Matrix C = -0.000135571 0.003038657 0.002891898 0.108336265 8.5706E-05 -0.003599653 0.069275 -0.112940741 The calculation that I am looking at has Matrix B / Matrix A = Matrix C I was trying to use a function in excel to match matrix C, but I have been unable to do this...

Problem w/MathType and KaleidaGraph embedded objects
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I am having trouble with embedded objects Word 2008 from either of the above programs. Note that I do not have problems with embedded objects created with Office applications such as Excel. I'm not sure about other applications. Here is what happens: If I open a Word Document created with either Word 2003 or Word 2007 on windows that contains an embedded MathType equation or Kaleidagraph graph, when I double click to open it with Word 2008 I get an error that says "Word is unable to locate the server application...

Exchange2K problem
Hi, I try in a new threat: I have two different lan/wan�s (and two different domaine�s). Domaine1 cannot recieve mail from Domaine2 - there is no problem the other way. Domaine1 can send mails to Domaine2 but Domaine1 cannot recieve any answers from Domaine2. There is also the same problem from two other domains: Domaine1 cannot recive mails from these two. If there more Domains with problems - I dont know. BUT: Domaine1 can recieve mails from everybody else with no problems. I cannot telnet from Domaine2 to Domaine1 port 25 - no connection can be obtained. No problem to telnet from Domai...

Send/Receive problems #3
When using MS outlook for my mail I'm unable to send/receive, as soon as I hit the 'send/receive' tab I get a message in the bottom bar saying 'Mail Delivery complete' with the animated envelopes. If I am sending an e-mail, it goes straight to the outbox, and stays there. I have checked all my settings, and have used 'detect and repair' but this has not helped. Please can anyone help? Thanks The majority of the time that this error occurs is when the mail server settings are correct but it is not recognizing your user name or password. The second and m...

Weird problem -- formulas get lost but their values stay in place
I have a client who uses Excel files that link out to other excel files. The formulas in the "main" file calculate from data in the linked files. So, the formula is in the main file. When they close the main file and re-open it, the formulas are gone, but the last calculated value remains. Does anyone have an idea why this would happen? Thanks, Bill One way might be because a "Before Save" or "Before Close" Macro is doing a Copy > Paste special > Values........ Vaya con Dios, Chuck, CABGx3 "Bill" <bdotson@gmail.com> wrote in message...

oulook calendar problems
When I schedule meetings using oulook 2002 for eg at 10am the receipients are getting invitations for incorrect hours. This could be 11am instead 10 am. The computer time and the time zones are correct. Can someone please help? Daylight Savings Time match in Outlook and Control Panel? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, babu datt asked: | When I schedu...

XML serialization problem #2
Hi all, I'm a .NET beginner and I've got a problem on a program where I try to do an XML serialization. I get the following error : "An unmanaged exception of type 'System.IO.FileNotFoundException' occured in mscorlib.dll Additonal information : the file or asssembly named n9gu4-bo.dll or one of its dependencies cannot be found" Here is the code : (I've uploaded the complete project at this url http://netorld.free.fr/Interface2.zip) public class Form1 : System.Windows.Forms.Form { .... .... public Form1() { InitializeComponent(); try { TextReader reade...

excel find problems
I have a database in excel with 4 sheets. When I want to conduct a search, it only searches the active sheet. Therefore I have to select each sepearte sheet and carry out 4 individual searches. Is there any way to search all sheets at once? If there is not, I am aware I can create a user form and use the approproate syntax to conduct my required search. However this will take me a long time. If there is an easier apprach then please let me know. Regards camron What version of excel? How are you searching? In later versions of Excel, you can select multiple sheets and have Edit|Fin...

Problem in ListCtrl
Hi All, I am having list ctrl with images and text underneath of the image. We are able to display images and text. I have two queries which is as follows 1. we have a requirement of drawing a rectangle when an item is selected using key or mouse click. Border should be of similar size. If we use GetItemRect( ) it does not give the same size for all the image. It varies depends on the text length. If we use our own RECT size that is 120X120 size then also it doesnot work properly. Since some times the currect rect intersects with the next image...

Recurring Meeting Scheduling Problem
I am attempting to schedule a recurring meeting using one of our conference room resources. In some cases there are conflicts with the dates/times since the resource has already been scheduled. How would I get the resource to accept the meeting notices for the dates/times that do not conflict? Currently I receive an email telling me the dates that conflicted but the dates that do not conflict are not scheduled and I'd like them to schedule. Using Exchanges 2007 and Office 2007. Thank you. With recurring meeting, its all or nothing. It can't accept some and not ot...

Installation problem money 2006
I have IE 8 on my Windows XP system. Every time I try to run setup for my money program, it gets an error about installing IE6 & aborts. I tried installing IE6 (probably can't have both on the computer at once, I don't know), and the error is that I have a newer version and cannot install the older one. It seems that when I installed the standard version of money, I had not yet installed the IE8, but I cannot remember. I've only had IE8 for a few months. Anyone able to tell me the easiest way to solve this? I have a dual boot system, and Win 98 is instal...

Problems With Adobe.com and IE 8
Someone told me that they were browsing on the computer today and a message from Google came up that said, an update to Adobe Flash Player is available, but they did not click on it or anything. I have cleared out my history, temp, and cache files in IE 8, rebooted and can not get to www.adobe.com to download the latest version of Adobe Flash Player, I know that Adobe is affiliated with Google.com. I went to Adobe's site, learning a long time ago NEVER to click on any pop up windows while browsing, and every time I go to www.adobe.com the page does not finish loading and the ...

Can I retreive a doc I closed but did not save from Excel?
I accidently closed an excel spreadsheet without saving it and I need to know if I can retrieve it without re-doing the spreadsheet. Hi if you haven't saved it it is gone for good -- Regards Frank Kabel Frankfurt, Germany "Cluelessnsleepless" <Cluelessnsleepless@discussions.microsoft.com> schrieb im Newsbeitrag news:DB2FE41A-7C54-46E8-AC08-96BBF606A78A@microsoft.com... > I accidently closed an excel spreadsheet without saving it and I need to know > if I can retrieve it without re-doing the spreadsheet. I, too, think you're out of luck for this file. But f...

wireless mini pci card problem
Hi, I have a Sony VAIO with windows xp home. It had been having problems with the mini pci wireless card. In devices it showed code 10. I pulled it out and put it back in and during boot up I got the error... Conflict PCI Network in slot 2 BUS 00 Device 07 Function 00. I can boot past that by hitting f1. Then, I started getting a fatal error memory parity problem. I had recently installed 1gb x2 kingston and it booted fine a few times, then I got the blue screen with the conflict error. I pulled out the new memory and installed teh previous memory and got the same error. I pulle...

Can I force confirmation prompt on close? Or tell Outlook to run in background?
I am constantly accidentally pressing the close button instead of "minimize" when I am at work. I press close explicitly but I would like behavior like antivirus or IM clients. I want Outlook to continue to run in the background, so it can continue to check for email, alarms, etc. Is there either a way to force confirmation of closure, or to have an outlook background task set up which doesn't close so easily? Rufus Rufus V. Smith <nospam@nospam.com> wrote: > I am constantly accidentally pressing the close > button instead of "minimize" when I am at ...

registry problem
I was trying to create a registry key for my dialog project and I added SetRegistryKey(_T("Simple Alarm Clock")); in BOOL CAlarm_ClockApp::InitInstance() , but nothing gets written to the registry. Is there anything else I need to do in order to get my dialog project to write to the registry? Z.K. That simply sets the registry key for the application. You still have to write something there. You can then use WriteProfileInt/WriteProfileString to write something at that key. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Z.K." <nospam@nospam.net> wro...

Money2004 install problems
I have a money 2004deluxe. When I installed it, a message windows pop up, which said there is antivirus software installed in your computer. Acutally, I had disaled the auto-protect. But I can not close the norton antivirus from the task manager. Anyone know how to handle this problem? I ignored the anitvirus warning and finished the installation. But each time I wanted to start the 2004 money, it said money encounter a problem and need colse. Do you want to send a report to MS? Is this caused by the Norton Antivirus? How to fix it? thanks The same thing happened to me. -- Regards, ...

Parameters in Unbound Object Frame
How to pass parameters to unbound object frame? I have ms Chart on unbound object frame, I llike to control the RowSource properties pprogramatically. Any idea or link? TIA Yanto ...

**Commission Calculation Problem**
Hi I need help on two things: Firstly, I am calculating a new business commission of 1% over a 3 month basis. If the campaign doesnt run as it should in the fourth month a clawback will kick in. Thisis manually checked but I want Excel to calculatethe final commissions. I only want the clawback to deduct from that months commission if its over �50.00, anything under �50.00 is written off. Therefore New commission - Clawback (only over �50.00) = Paid commission that month. I think I need to use an If Statment but having only used these in training Im finding it hard to put it into pr...

Time-problem
Hello I have a timesheet where I enter start and end times. My problem is that I want to check if any or all of the elapsed time falls into a certain timeframe. Here is an example. If I put 07:00 into D4 and 16;00 into G4 in H4 the answer is 9, Which is correct (I use C Pearsons formula so I can calculate shifts over midnight.. Then I want to se if the timeframe specified falls into into a timeframe between 19:00 to 06:00 and show the result in I4. D4 G4 H4 I4 04:00 14:00 10 2 17:00 23:00 6 4 21:00 05:00 8 ...

Problems calculating total hours
I am trying to create a wokr sheet that calculates the total hours worked in a day utilizing hour:minute format. I've tried using =HOUR(B1-A1), and although the hours get added the minutes don't and I do need a formula that can calculate hour and minute and give me a total of how many there are in that work day. Hi just subtract both values: =B1-A1 and format as time if your workin day can span midnigth use =B1-A1+(B1<A1) or =MOD(B1-A1,1) -- Regards Frank Kabel Frankfurt, Germany LolaK wrote: > I am trying to create a wokr sheet that calculates the total hours > wor...