Skip to main content
Inspiring
July 12, 2011
Question

Can I use 32 bit ODBC with CF9?

  • July 12, 2011
  • 6 replies
  • 4036 views

I'm trying to move my existing

applications from CF5 to CF9.

New server is Win 2008 R2 with CF9 64 bit installed.

I setup my data sources using the 32 bit ODBC data source administrator because there is no 64 bit dBase ODBC Driver. We have legacy MD-Dos applications that still add/edit dBase data and my CF applications need to

read this data. (No need to add/edit). This was never a problem with CF5.

When I am adding the data source in the CF Administrator and I choose "ODBC Socket" as the driver it only lists data sources created with the 64 bit ODBC data source administrator. A dBase driver is not offered as a choice in the 64 bit administrator.

BTW, if I choose

Microsoft Access as the driver the CF administrator displays the following error: "Unable to update the NT registry. Variable DRIVERPATH is undefined". But the data source setup using the 32 bit managers still works fine.

Does anyone know how I might be able to setup a dBase driver for my new CF 9 server?

Thanks in advance.


    This topic has been closed for replies.

    6 replies

    December 9, 2011

    Just incase anyone else happens to stumble across this thread.. I was unable to get Stels JDBC driver working following the instructions above. And even if it worked, I could only obtain the trial version which returns only the first 1000 rows.

    That being said, I found a work around that allows full access to DBFs using free tools.

    First you'll need to download Microsoft Access Database Engine 2010 Redistributable which can be obtained from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=13255

    Make sure you download the x64 version!

    After you've installed MADE 2010, you'll need to create your datasource in the ODBC Data Source Administrator, BOTH the 32 and 64 bit versions. Use the exact same settings and DSN name for both instance of the source.

    32 bit version c:\windows\system32\odbcad32.exe

    64 bit version c:\windows\SYSWOW64\odbcad32.exe

    After you've created both DSNs, create the datasource in CF Administrator and you should be good to go.

    Inspiring
    July 14, 2011

    Thanks everyone!

    Inspiring
    July 14, 2011

    Problem solved!!

    The HXTT vendor from China had a installation document fro CFMX 6.0 and while reading it I saw their jar file needed to be in the WEB-INF folder. So, I tried it with the Stels product.

    I copied the jar file to c:\coldfusion9\wwwroot\WEB-INF\classes\dbfdriver.jar and the datasource is working!

    I immediately hit some SQL errors as there are some language differences, but that can be worked out!

    Thanks again for all the assistance.

    Lyndon

    Solotion:

    Driver Type = other

    JDBC URL = jdbc:jstels:dbf:c:/programs/license

    Driver Class = jstels.jdbc.dbf.DBFDriver2

    jar location = c:\coldfusion9\wwwroot\WEB-INF\classes\dbfdriver.jar

    Inspiring
    July 13, 2011

    I have no experience with jdbc...

    Trying to setup the demo jdbc driver from jstels and have no idea what I'm doing.

    Get this error:

    Connection verification failed for data source: Lic11
    java.sql.SQLException: No suitable driver available for Lic11, please check the driver setting in resources file, error: jstels.jdbc.dbf.h2.DBFDataSource2
    The root cause was that: java.sql.SQLException: No suitable driver available for Lic11, please check the driver setting in resources file, error: jstels.jdbc.dbf.h2.DBFDataSource2

    Info from verdor:

    Installation

    Add the file dbfdriver.jar to your classpath or extract the jar file in the directory of the application.

    Description

    Classes

    Driver class (JDBC API v1.0)

    jstels.jdbc.dbf.DBFDriver2

    Data Source class (JDBC API v2.0)

    jstels.jdbc.dbf.h2.DBFDataSource2

    Connection Pool Data Source class (JDBC API v2.0)

    jstels.jdbc.dbf.h2.DBFConnectionPoolDataSource2

    absolute or relative path to the local directory containing text files, e.g.:

    jdbc:jstels:dbf:c:/mydir/dbffiles

    I copied their jar file to c:\coldfusion9\lib

    On the add data source page I provided only this data:

    Data source Name: Lic11

    JDBC URL : jdbc:jstels:dbf:c:/programs/license

    Driver Class : jstels.jdbc.dbf.h2.DBFDataSource2

    Otherwise I don't know what else is required. Is Driver Name normally required? I saw nothing in their documentation saying what the driver name is.

    Thank for reading...

    Charlie Arehart
    Community Expert
    Community Expert
    July 13, 2011

    Lyndon, did you check out the docs I referred to, both the online help within the CF Admin (best accessed on the page where you are adding an "other" DSN) and the "Configuring and Administering CF" manual? They cover the process of adding such an "other" driver, including where to put the jar files, how to configure the Admin, etc. You may also need to restart CF for it to pick up the database driver. (I don't use "other" drivers enough to know all the details off the top of my head, and I'm just about to head out for meetings so can't test things for you myself.) Hope that's helpful.

    /charlie

    /Charlie (troubleshooter, carehart. org)
    Inspiring
    July 13, 2011

    I've also found a driver from Stels http://www.csv-jdbc.com/index.html.  While they are not on the Sun.com vendor list, I may have a problem buying hxtt as they are in China. State government has some tough rules.

    .

    I'll try both demo versions and report back.

    Again, if any one has experience with either vendor I'm all ears!

    Charlie Arehart
    Community Expert
    Community Expert
    July 12, 2011

    Wow, that's quite a leap (5 to 9), and no I've never heard of anyone using dbase with CF (since you asked). But it does and has long supported "any" database that offers an odbc (or since CF6, a JDBC driver). I'll ask first: do you know if there may be a JDBC driver for dbase? If so, that may be the better way to go. You'd use the "other" driver option when adding a new DSN, and build what's called the jdbc url to point to it. Any docs on such a JDBC driver for dbase would explain what's needed there.

    As for running odbc, your problem is not with CF but really with 64 bit. There's just a lot of mess trying to run ODBC on 64 bit machines.

    Anyway, if you googled the error (odbc "Unable to update the NT registry"), you'd find the first hits include many references with proposed solutions. While none refer to dbase, the concepts apply regardless:

    http://www.cfexecute.com/post/access-dsns-in-64bit-coldfusion

    http://forums.adobe.com/thread/21257

    http://forums.adobe.com/message/1971734

    Let us know if that solves things for you.

    /charlie arehart

    charlie@carehart.org

    Providing fast, remote, on-demand troubleshooting services for CF (and CFBuilder)

    More at http://www.carehart.org/consulting

    /Charlie (troubleshooter, carehart. org)
    Inspiring
    July 12, 2011

    Thank you for your response Charlie!

    Yes it a big leap. I'm a one man IT shop for a very small state government agency. Money is always a huge limiting factor. The servers I'm retiring are 13 year old running win2k. I've been on CF since the early Allaire days. New servers have MSSQL and I will hopefully replace the legacy dBase applications soon. But I need this bridge solution in the mean time.

    I looked up dBase JDBC drivers on sun.com. They only have one partner/vendor with a dBase product. It is HXTT at http://www.hxtt.net/ they have a product named HXTT DBF v5.0. It looks to me like it might work.

    However I have no idea if it would work with the CF Administrator. If anyone knows if it would work by looking at the specs I would truly appreciate it. I'm going to call them as well and will report back.

    If I can't find a dBase driver I'm looking at rewriting thousands of lines of code before I can move us onto the new server. Time I'd rather spend replacing legacy apps with SQL solutions.

    Legend
    July 13, 2011

    Hi Lyndon,

    Back in the day I used CF Standard to an informix database. While CF Enterprise had a informix driver built in Standard did not. I ended up downloading a JDBC driver from IBM (then owners of informix). Once I had the JDBC JAR file, that is the driver, it was a matter of putting the JAR in the Java path eg ColdFusion9\lib or probably more correctly define a Class Path; CFadmin > Server Settings > Java and JVM > ColdFusion Class Path > eg ColdFusion9\lib\thirdpartytools > submit change and put the JAR file in there (eg ColdFusion9\lib\thirdpartytools\ifmxjdbc.jar). Once the JAR file in place CF will require a restart.

    Connecting CF to the database was done as such; CFadmin > Data & Services > Data Sources > Add New Data Source  use Driver > other and key in the appropriate JDBC details. The FAQ on the JDBC dbase driver site you mention has some syntax examples:

    http://www.hxtt.com/dbf/faq.html

    If it does not work likely useful debug information will be in the OUT or EVENT log files located in ColdFusion9\runtime\logs

    All the best with that, Carl.