Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Jet OLEDB driver caches my MDB file?

I have a Cassini application that uses Access file. Updated installer overwrites both application and database. However, application still sees the old data even after system restart. (Also copied MDB file manually to make sure it's replaced but it doesn't help.)

The only way for the application to see new MDB data is to install it to a new folder.

Connection string is standard (I think):

Connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + 
    HttpContext.Current.Server.MapPath("App_Data\\" +
    ConfigurationManager.AppSettings.Get("dbfile")) + ";Jet OLEDB:Database Password=xxxx";

Any idea what's going on and how to avoid the caching issue?

Update (to answer some questions in comments):

  • We can reproduce this issue only on Windows 7.
  • MDB is never updated by the Cassini application. We create database and send it to users. - We did make sure that file was successfully replaced by installer. Actually the same thing happens if we replace it manually.
  • The problem remains after Windows reboot.
like image 974
tomsame Avatar asked Nov 25 '11 08:11

tomsame


1 Answers

  1. Go to solution Explorer
  2. Select mdb file
  3. Go to properties, there is one property
  4. Do not copy set it to Copy if newer
like image 115
tayyab huusain Avatar answered Sep 22 '22 17:09

tayyab huusain