Menu

Mdb + Mdw system database

Help
2015-12-10
2015-12-12
  • KIM BELANGER

    KIM BELANGER - 2015-12-10

    Hi everyone,
    i am trying to connect to an access database protected with a system database (MDW)
    I'm doing this from Lucee (Railo fork). So far i managed to open and read a standard MDB like this:

    in Application.cfc i put this:

    this.datasources['testdb']={
                class:'net.ucanaccess.jdbc.UcanaccessDriver',
                connectionString:'jdbc:ucanaccess://Z:/SQL_DATA/Mdaemon.mdb'
            };
    

    And the query works flawlessly like this:

    <cfquery name = "test" datasource = "testdb">
        SELECT * FROM userlist
    </cfquery>
    
    <cfdump var = "#test#">
    

    But i'm not sure how to add the system database in the connection string. Someone smarter figured it out already ?

    A JET conn string would ressemble that:

    "Provider=Microsoft.JET.OLEDB.4.0; Data source=DB.mdb;Jet OLEDB:System Database=SYS.mdw;User ID=Admin; Password=Pass"

    Some context here:
    http://blog.getrailo.com/post.cfm/railo-4-1-explicit-datasources-in-application-cfc

     

    Last edit: KIM BELANGER 2015-12-10
  • Gord Thompson

    Gord Thompson - 2015-12-12

    UCanAccess uses Jackcess to read and write the Access database file, and Jackcess does not use the Workgroup information file (.mdw) to open encrypted Access files (such as those to which User Level Security has been applied).

    Instead, Jackcess uses Jackcess Encrypt, which in turn uses the encryption library from Bouncy Castle. So, to open an encrypted Access file with UCanAccess you need to ...

    (1) Add the Jackcess Encrypt and Bouncy Castle libraries to your project, specifically

    jackcess-encrypt-2.1.1.jar (or newer)
    bcprov-jdk15on-153.jar (or newer)

    (2) Add your own custom "Opener" class to your project as described on the "Getting Started" page of the UCanAccess site, and

    (3) Add the jackcessOpener= parameter to your connection URL, e.g.,

    this.datasources['testdb']={
                class:'net.ucanaccess.jdbc.UcanaccessDriver',
                connectionString:'jdbc:ucanaccess://Z:/SQL_DATA/Mdaemon.mdb;jackcessOpener=yourPackage.example.CryptCodecOpener'
            };
    
     

    Last edit: Gord Thompson 2015-12-12

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.