Hello
I will to read and modify MS Access file from C#.
It's about read and modify Custom properties under Database Properties of
access file.
Normaly under Microsoft Access, user show this when go to File menu, and
Database Properties menu. I wilsh to get this from C# and modify it.
I also have VS and VS Tools for Office 2003. I'm greatfull for any suggestion.
Thanks
Milan
Cindy M. - 08 Nov 2006 14:45 GMT
Hi =?Utf-8?B?TWlsYW5C?=,
> I will to read and modify MS Access file from C#.
> It's about read and modify Custom properties under Database Properties of
[quoted text clipped - 4 lines]
>
> I also have VS and VS Tools for Office 2003. I'm greatfull for any suggestion.
See if the information in this article helps. DSOFile is a program provided by
Microsoft that lets non-C++ developers access the Office document properties.
I've never tried this with Access, but I think it should work.
http://support.microsoft.com/kb/224351/en-us
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
MilanB - 12 Nov 2006 23:31 GMT
I found solution by myself and by searching newsgroups.
There are little talks on this theme, so I wish to show others how to solve
this problem.
C# code use Automation for Access.
Must be added reference on Microsoft Access 11.0 Object Library (for Access
2003).
Access.Application dbToModifyAccess = new Access.ApplicationClass();
dbToModifyAccess.OpenCurrentDatabase(dbPath, true, "");
dbToModifyAccess.CurrentDb().Containers[1].Documents["UserDefined"].Properties["Version"].Value = "1.0.1.7";
dbToModifyAccess.CurrentDb().Containers[1].Documents["SummaryInfo"].Properties["Subject"].Value = "My Subject";
dbToModifyAccess.CloseCurrentDatabase();
dbToModifyAccess.Quit(Access.AcQuitOption.acQuitSaveAll);
Best Whishes
Milan