|
-
Oct 19th, 2000, 05:31 AM
#1
Thread Starter
Fanatic Member
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.
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Oct 19th, 2000, 06:44 AM
#2
Lively Member
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.
-
Oct 19th, 2000, 06:51 AM
#3
Thread Starter
Fanatic Member
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.
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Oct 19th, 2000, 06:52 AM
#4
Lively Member
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.
-
Oct 19th, 2000, 06:55 AM
#5
Thread Starter
Fanatic Member
Cheers yet again!! 
I'll try it out.
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|