Midnight2005
asked on
Openning Access from .NET
I have Access 2003 and VS 2005.
This is what I currently have:
objAccess1 = New Access.ApplicationClass()
If Not objAccess1.Visible Then objAccess1.Visible = True
objAccess1.OpenCurrentData base(filep ath:=strRp tPath & "x.MDB", Exclusive:=False)
If Not objAccess1.UserControl Then objAccess1.UserControl = True
objAccess1.RunCommand(Comm and:=Acces s.AcComman d.acCmdApp Maximize)
objAccess1.DoCmd.SelectObj ect(Object Type:=Acce ss.AcObjec tType.acMa cro, _
ObjectName:="MyForm", InDatabaseWindow:=True)
objAccess1.DoCmd.RunMacro( "MyForm")
objAccess1.DoCmd.Maximize( )
I need to open a form in Access from my VB app, I maximized it but users are still able to go to Database Windows inside Access and be able to reach my LInk Table to SQL Server. I don't want them to see the records like that. I need to put some security.
I saved the Access going to Startup, unchecked "Display Database WIndow", but no help, it's still showig.
Any help?
And the other thing is once Access opens thru my app, even if the user closes it, nobody can open any other Access databases until my Application is completely closed. I realized the Access stays in memory somehow even if they click the X on the corner. I tried disposing it but it still stays until we exit the app completely.
This is what I currently have:
objAccess1 = New Access.ApplicationClass()
If Not objAccess1.Visible Then objAccess1.Visible = True
objAccess1.OpenCurrentData
If Not objAccess1.UserControl Then objAccess1.UserControl = True
objAccess1.RunCommand(Comm
objAccess1.DoCmd.SelectObj
ObjectName:="MyForm", InDatabaseWindow:=True)
objAccess1.DoCmd.RunMacro(
objAccess1.DoCmd.Maximize(
I need to open a form in Access from my VB app, I maximized it but users are still able to go to Database Windows inside Access and be able to reach my LInk Table to SQL Server. I don't want them to see the records like that. I need to put some security.
I saved the Access going to Startup, unchecked "Display Database WIndow", but no help, it's still showig.
Any help?
And the other thing is once Access opens thru my app, even if the user closes it, nobody can open any other Access databases until my Application is completely closed. I realized the Access stays in memory somehow even if they click the X on the corner. I tried disposing it but it still stays until we exit the app completely.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi again,
I am not sure if you can do something like,
objAccess1.Application.Set Option("Sh ow Hidden Objects", False)
or you may need to substitute 0 for False.
Cheers,
Nick
I am not sure if you can do something like,
objAccess1.Application.Set
or you may need to substitute 0 for False.
Cheers,
Nick
ASKER
I meant to ask hiding "Database Window", the one that has tables, queries, reprts, macros, etc...
Sounds like it is not possible though.
Sounds like it is not possible though.
Hi again,
VBA has a StartupShowDBWindow option so I assume you might be able to use this from .NET as well. Haven't tested it but I would assume it is something like:
objAccess1.Application.Sta rtupShowDB Window = False
Hope this helps,
Nick
VBA has a StartupShowDBWindow option so I assume you might be able to use this from .NET as well. Haven't tested it but I would assume it is something like:
objAccess1.Application.Sta
Hope this helps,
Nick
ASKER
Making tables invicible doesn't stop users to be able to go in, some keep show hidden setting on. I diabled the toolbar from Startup options. When I directly open, it's fine but when the application opens the Access database, and when user closes the form, they are able to see the Database Window.
I wonder if there's a way somehow...maybe using the objAccesss?