Connect Crystal Report to Access MDB with security MDW file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • relicx2004
    New Member
    • May 2014
    • 9

    Connect Crystal Report to Access MDB with security MDW file

    I'm using VS2010(VB.NET) and Crystal report IX
    The report is connected to a MS ACCESS .MDB with a .MDW system database file.
    Since I want to dynamically change the database path programmaticall y, I'm having a hard time figuring out the correct ConnectionInfo settings in viewing the report.
    I tried searching on the net but failed to come up with the correct solution.
    Below is a sample of my ConnectionInfo code. Appreciate any help or suggestion.

    Code:
            
    With crConnectionInfo
       .ServerName = "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=D:\Documents\db.mdb;Jet OLEDB:System Database=D:\Documents\CRBSecurity.mdw;User ID=MyUsername;Password=Mypassword;"
       .DatabaseName = "D:\Documents\db.mdb"
       .UserID = "MyUsername"
       .Password = "Mypassword"
    End With
  • relicx2004
    New Member
    • May 2014
    • 9

    #2
    Problem solved. It turned out to be an easy task.
    Changed database connection of the crystal report from DAO to ADO and filled the connection information. Then modified code to:

    Code:
    With (crConnectionInfo)
        .UserID = "MyMDWWorkgroupUserName"
        .Password = "MyMDWWorkgroupPassword"
    End With

    Comment

    Working...