Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2006

Tip: Looking for answers? Try searching our database.

How to read Ms Access file DatabaseProperties from C# or VB.NET?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MilanB - 07 Nov 2006 15:15 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.