CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 3 of 3 FirstFirst 123
Results 31 to 37 of 37
  1. #31
    Join Date
    Nov 2009
    Posts
    40

    Re: couldn't lock file

    The user needs to obtain some report these days. I do not have time to implement logging. I put some messages in the app and the app worked ok. But using the app without messages doesn't work any more. To do all you said I need time which I do not have.

  2. #32
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: couldn't lock file

    may be some simultaneous locking problem from diff users is causing the problem. try to use semaphores or mutex for synchronisation..

  3. #33
    Join Date
    Nov 2009
    Posts
    40

    Re: couldn't lock file

    I assume the "lock" is about the mdb. On that computer only one user is working. I don't know to use semaphores or mutex.

  4. #34
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: couldn't lock file

    Quote Originally Posted by florivucu View Post
    The user needs to obtain some report these days. I do not have time to implement logging.
    You spent much more time for the long discussion here than you'd needed to implement logging.

    // EDIT: besides, time only matters if your App works, which is, unfortunately, not the case.
    Last edited by VictorN; July 14th, 2010 at 02:22 AM.
    Victor Nijegorodov

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

    Re: couldn't lock file

    Quote Originally Posted by florivucu View Post
    The user needs to obtain some report these days. I do not have time to implement logging. I put some messages in the app and the app worked ok. But using the app without messages doesn't work any more. To do all you said I need time which I do not have.
    At least implement the try/catch blocks, catch and report the error. You may learn something.

    FWIW, Requery after Open is redundant. You should remove it.

  6. #36
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: couldn't lock file

    Quote Originally Posted by GCDEF View Post
    FWIW, Requery after Open is redundant. You should remove it.
    Correct! good catch!

    Or, at least insert else between them!
    Code:
    	RstStatii.m_strFilter.Format("CODSTA = %ld",codes);
    	if (!RstStatii.IsOpen())	
    		RstStatii.Open(dbOpenSnapshot);
    	else
    		RstStatii.Requery();
    Victor Nijegorodov

  7. #37
    Join Date
    Nov 2009
    Posts
    40

    Smile Re: couldn't lock file

    Problem solved. Thanks to all. The problem has been solved by reinstalling the MS Office. I will keep in mind to apply all you said in the new release. Many thanks to all.

Page 3 of 3 FirstFirst 123

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