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 / April 2004

Tip: Looking for answers? Try searching our database.

Opening .mdb file only for viewing purpose.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Suma - 27 Apr 2004 11:31 GMT
H

I want to open an .mdb file for viewing purposes to the User
The User should not be able to change anything contained in that database
He should be able to only view the contents
How can I achieve this
For Word,Powerpoint and Excel, in the Open method itself we can specify whether the file is to be opened as Readonly
But I do not find any such specification for access .md
I do not want to change the attributes of file and make it Readonly
The code that I am using right now i

 Dim objAccessAppl As Microsoft.Office.Interop.Access.Applicatio
objAccessAppl = New Microsoft.Office.Interop.Access.Applicatio
               objAccessAppl.Visible = Tru
               objAccessAppl.OpenCurrentDatabase("Filename.mdb", False

Can anyone please guide how to do this
I am using Access 10.0 object library in VB.NET

TIA
Paul Clement - 27 Apr 2004 15:00 GMT
¤ Hi
¤
¤ I want to open an .mdb file for viewing purposes to the User.
¤ The User should not be able to change anything contained in that database.
¤ He should be able to only view the contents.
¤ How can I achieve this?
¤ For Word,Powerpoint and Excel, in the Open method itself we can specify whether the file is to be opened as Readonly.
¤ But I do not find any such specification for access .mdb
¤ I do not want to change the attributes of file and make it Readonly.
¤ The code that I am using right now is
¤
¤   Dim objAccessAppl As Microsoft.Office.Interop.Access.Application
¤  objAccessAppl = New Microsoft.Office.Interop.Access.Application
¤                 objAccessAppl.Visible = True
¤                 objAccessAppl.OpenCurrentDatabase("Filename.mdb", False)
¤
¤ Can anyone please guide how to do this?
¤ I am using Access 10.0 object library in VB.NET.

Try using objAccessAppl.DBEngine.OpenDatabase with the ReadOnly argument set to True first and then
call OpenCurrentDatabase.

Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)

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.