Setting Database Password at runtime

bitaoo used Ask the Experts™
Hello friends,

I have another question. I am using Microsoft Access
database, Crystal Report 9 and VB6. I defined a
password for my database, my problem is that when
I want to run the report through my VB6 application
I get this error:
     Logon failed.
     Details: DAO Error Code: 0xbd7
     Source: DAO.Workspace
     Description: Not a valid password.
Please let me know how can I set the password at
run-time for the reports, or how can I solve this

Thanks for your help,
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2012



I know, I made a mistake. :(
Any way if anybody in this group can help me, I
appreciate that. Thanks
Depends on how you are running the report from VB.  If you are using the CrystalReports OCX, you can use:

CrystalReport1.Password = "mypassword"
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!


Thanks a lot bhess1, but I am using RDC not OCX.
Here is a sample application from Crystal Decisions, showing how to use the RDC to to dynamically set the password for a report connected to a Microsoft Access database (with database level security).


Thanks a lot. You are great. :)

I am having this problem now and the link doesn't work.. Anybody know anything about this solution?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial