I have a really strange problem with ADOX Interop.
I have this code:
try
{
if (File.Exists(path))
File.Delete(path);
var cat = new CatalogClass();
cat.Create("Provider=Microsoft.Jet.OLEDB.4.0; Data Source = d:\\Test.mdb; Jet OLEDB:Engine Type=5");
Marshal.ReleaseComObject(cat);
cat = null;
GC.Collect();
}
catch (FileNotFoundException e)
{
throw new FileNotFoundException("El archivo no se encuentra", e);
}
catch (COMException e)
{
throw new COMException(connStr + e.Message);
}
catch (Exception e)
{
throw new Exception(connStr, e);
}
The code is failing in the cat.Create() line. What is really weird is that on my local developer machine it works fine, but in the production server doesn't... It isn't a write permissions problem, because i have tried to generate a random file before the problem line and worked perfectly. The COMException message is only "Not specified Error" HResult: -2147467259
The Server OS is Windows 2008 32bits. I think is a server configuration issue, but can you give me some light? I don't know what else I can do...