Skip to main content
ilssac
Inspiring
July 28, 2011
Question

CF Hibernate ORM and MS Access

  • July 28, 2011
  • 1 reply
  • 2011 views

I know, I know, MS Access.  But this task is the first step to start a process to eliminate a large number of heritage Access applications.

I am trying to use the CF9 Hibernate feature for the first time.  Should I expect it to work with an Access database?  The documentation seems to hint that is should, but I am getting a "Table Not Found" error that I can not understand.

I have a fifteen year old Access database, configured in ColdFusion on my workstation.  The DSN tests OK with the basic MS Access driver.  Using the MS Access Unicode driver throws an Jet Driver error.

I can run a basic query with <cfquery...> and retreive a simple table from this database.

This works:

    <cfquery name="prefixes">
        SELECT *
        FROM PREFIXES
    </cfquery>
    <cfdump var="#prefixes#">

I try to set this up with ORM as follows:

Applicaiton.cfc

<cfcomponent>
    <cfscript>
        this.name = "eval_scientists";
        this.datasource = "eval_scientists";
        this.ormenabled = true;
        this.ormsettings = {
                dialect = "MicrosoftSQLServer",
                logsql = true
            };
    </cfscript>
</cfcomponent>

prefixes.cfc

<cfcomponent persistent="true" table="PREFIXES">
    <cfproperty name="id" column="PREFIX">
    <cfproperty name="description" coluumn="DESCRIP">
</cfcomponent>

test code

    <script>
        prefixes = EntityLoad("prefixes");
    </script>
     <cfdump var="#prefixes#">

Running this version produces this error:

Table PREFIXES defined for cfc eval-scientists-orm.cfc.prefixes does not exist.

Is there any hope for me?  Or am I just out of luck with this combination of technologies?

This topic has been closed for replies.

1 reply

Inspiring
July 28, 2011

Should I expect it to work with an Access

database? 

I honestly have not a clue But I can at least confirm your test code worked for me.

MS Access 2000 database (oldest I could find)

CF 9.0.1

Driver: MS Access Unicode

coluumn="DESCRIP">

I assumed "coluumn" was just a typo

ilssac
ilssacAuthor
Inspiring
July 28, 2011

-==cfSearching==- wrote:

I assumed "coluumn" was just a typo

Yes it was a typo I discovered and corrected after I posted my original question.  My IDE does not grok CF9 syntax, so I am on my own for typing new CF9 tags and properties.  Fixing it made no change to the error.

-==cfSearching==- wrote:


MS Access 2000 database (oldest I could find)

CF 9.0.1

Driver: MS Access Unicode

Interesting that yours works with MS Access w/ Unicode against an Access 2000 database.

This is a very old database, possibly created as far back as version Access 97, nobody knows anymore.  I have it installed on my workstation which is currently using Access 2010.  I can open and work with the mdb file in 2010.

When I set up the DSN in ColdFusion the MS Access Unicode driver DOES NOT work for me. I get this error.

Connection verification failed for data source: eval_scientists_unicode
                         com.inzoom.adojni.ComException: Unspecified error
                         The root cause was that: com.inzoom.adojni.ComException: Unspecified error in Microsoft JET Database Engine code=0 Type=1

The DSN works with the non-Unicode MS Access driver on my workstation.  Could this be a factor?  Does the Hibernate functionality need the Unicode driver?  If so, why would the MS Access 2000 database use the Unicode driver, but not the 2010?

Is it an issue that I have three versions of Access on my workstation?  I tried opening the mdb file with the Access 97 and Access 2003 that I have, neither could open it.  I presume that my Access 2010 has made the mdb file it's own since I have opened the file with that version and poked around.

Inspiring
July 28, 2011

The DSN works with the non-Unicode MS Access driver on my

workstation.  Could this be a factor?  Does the Hibernate

functionality need the Unicode driver? 

From what I have read, it expects a well behaved jdbc driver which is tough with Access.

I presume that my Access 2010 has made the mdb file it's own

since I have opened the file with that version and poked

around.

That might be the problem. I have never even tried an Access 2010 database with the unicode driver. I am not sure it can read that format. If you have Access 2003 installed, how about creating a new database in that format. See if there is any difference.