|
-
July 12th, 2010, 06:23 AM
#16
Re: couldn't lock file
1. What happened if you'd move database to some other drive/location (say, in d: )?
2. How do you access your db: via ODBC, DAO, ADO? (it looks like you are using DAO- ?). Are you using try/catch blocks (I don't see any in the code snippet you've posted)
Victor Nijegorodov
-
July 12th, 2010, 07:16 AM
#17
Re: couldn't lock file
 Originally Posted by florivucu
I'm using google but there is no connection between calipso and calypso. "Calipso" is the name of my app. What appears under the link you gave me is not helping me.
Sheesh
http://www.google.com/#hl=en&source=...6ec6be010d257f
-
July 12th, 2010, 11:15 AM
#18
Re: couldn't lock file
Check the restrictions of the database you're using. It could be you're exceeding some of it's limits. Several database systems limit how many concurrent locks you can set. Or limit the size/complexity of transactions. The limits could be hardcoded (nothing youc an do other than changing database engine). Or they could be restrictions you can change via some settings, increasing the lmits may increase memory consumption and degrade performance however, so again, check the documentation of your database.
-
July 12th, 2010, 12:43 PM
#19
Re: couldn't lock file
The app is accesing the database with both ODBC and DAO. I'm at home now but I'm pretty sure I'm not using any of the try/catch block you mention. I have a feeling that - maybe - on that computer, on the long routes something goes wrong. Maybe while checking for the name it is going too far and the app overwrite some code. Do you think it is possible? I will check also the restrictions but the app works ok in 100 location. Only this is with problems. Again thank you for your support.
-
July 12th, 2010, 01:33 PM
#20
Re: couldn't lock file
 Originally Posted by florivucu
The app is accesing the database with both ODBC and DAO. ... I'm pretty sure I'm not using any of the try/catch block you mention.
Very bad. You have to..., otherwise, you cannot get any useful info in the case something in DAO/ODBC failed.
Victor Nijegorodov
-
July 13th, 2010, 01:37 AM
#21
Re: couldn't lock file
The function which give us the name looks like this:
........
long codes = atol(sta_code);
CString sta;
if (codes == 0)
return "";
CStatiiSet RstStatii;
RstStatii.m_strFilter.Format("CODSTA = %ld",codes);
if (!RstStatii.IsOpen()) //varianta pt. OpenTable (OLE)
RstStatii.Open(dbOpenSnapshot);
RstStatii.Requery();
sta=RstStatii.m_DENSTA;
RstStatii.Close();
return sta;
....
The user is admin on the machine. The mdb was removed and reinstalled. I could open the mdb and it was ok. Yesterday afternoon the app worked ok on the same long path. This morning it did not work. So, what can it be?
-
July 13th, 2010, 01:48 AM
#22
Re: couldn't lock file
Victor Nijegorodov
-
July 13th, 2010, 01:50 AM
#23
-
July 13th, 2010, 02:18 AM
#24
Re: couldn't lock file
 Originally Posted by florivucu
no virus found
Virus is a vere rare reason of .ldf file corruption.
Did you try just to delete .ldb file?
Victor Nijegorodov
-
July 13th, 2010, 02:50 AM
#25
Re: couldn't lock file
no, I did not. What can I expect deleting this file? This file is deleted after closing the app. I asked the user to look aver it but there is no ldb.
-
July 13th, 2010, 02:55 AM
#26
Re: couldn't lock file
Then perhaps, your .mdb file has been corrupted? Try to open it with MS Access or some other App that can work with .mdb files.
Victor Nijegorodov
-
July 13th, 2010, 03:28 AM
#27
Re: couldn't lock file
I did open the mdb. It is ok. No problems.
-
July 13th, 2010, 07:37 AM
#28
Re: couldn't lock file
What is the statement that causes the lock error?
Is it the RstStatii.Open or the RstStatii.Requery?
If you don't know set a breakpoint to both statements.
In any case I am pretty sure that VictorN is right and the error is related to the kb306441 error when the application has no or no sufficient priviliges for locking the .ldb file. For example it could be a difference whether you copied an existing .ldb file from elsewhere or whether you were not be able to create a new one.
To verify that you simply may create a folder like c:\temp\db and use that rather than using c:\ root folder.
If you encounter the lock errors nevertheless, check whether there is another connection parallel. It could be MS Access or you were using multiple connections in your app.
-
July 14th, 2010, 12:51 AM
#29
Re: couldn't lock file
I cannot use debug - breakpoints - because on that computer we use only the exe file. The last solution is to reinstall Windows and Office, too.
-
July 14th, 2010, 01:01 AM
#30
Re: couldn't lock file
1. Note that to work with .mdb database you don't need to install office at all.
2. Fix your code adding try/catch blocks and displaying message boxes in the cases of exceptions.
3. Implement logging (writing current info in some .txt file)
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|