Thought I'd posted this earler, but seems to have disappeared.
Anyway can somebody out there let me know how to utilise Access Reports in a secured database from VB.
This will save me tonnes of work, so please help me out here. :)
Printable View
Thought I'd posted this earler, but seems to have disappeared.
Anyway can somebody out there let me know how to utilise Access Reports in a secured database from VB.
This will save me tonnes of work, so please help me out here. :)
Ensure you have a reference set to Access in your project then do the following:
Dim appAccess as Access.Application
Set appAccess = New Access.Application
appAccess.OpenCurrentDatabase "Full Path Here", False
appAccess.DoCmd.OpenReport "Name", View, Filter, Where...
Look up OpenReport in help from VB for more info on the parameters.
I can't remember how to send the username and password but I've done it before so if it's any consolation to you it is possible. Do a search for posts from me on this site as I beleive I posted the same question here a long time back.
Best regards,
Rob Brown.
Cheers, thats what I have been doing, but I haven't figured out how to send the username and password yet.
I wonder if there is a way to do it with using a data source name.
I'll have a search through your posts.
Cheers again.
Found It!
After creating your new Access application but before invoking the OpenCurrentDatabase method, slop in the following
appAccess.DBEngine.DefaultUser="Your access user name"
appAccess.DBEngine.DefaultPassword="Your access password"
Hope that clears it up for you.
Best regards,
Rob Brown.
Cheers yet again!! :)
I'll try it out.