setting up a DB connection to a .DBF using CF

Posted on 2005-04-13
Last Modified: 2013-12-24
Hi all,
I am on an intranet and there's a network drive that has a .DBF file containing a product catalog (price,cost,SKU, etc.) for our sales registers.  As of right now there is no way to add/delete/update this catalog unless you use the sofware application tbat uses the file (which is located only on the PC that has the register).  

I would like to create a back-end in CF that can be used to manipulate the file's data (change product costs,prices, etc.) using cfquery (SQL) like you can do with an access DB...that way I can manage the catalog from another PC on the network.  I've read a limited amount of information about establishing a connection to a .DBF, and it appears it's similar to setting up an excel file.  

specifications of note:
using CF MX 6
this is an intranet with several drives and setting up a datasource would not be a problem in CF administrator...however, I are not sure which driver (if any to use)

Any thoughts?
Question by:scripkilla
    LVL 14

    Accepted Solution

    Hi scripkilla!

    To accomplish what you want to achieve, follow these steps :

    1.  Configure your system data source on ODBC Data Source Administrator.
         - click Start > Settings > Control Panel > Administrative Tools > Data Sources (ODBC)
         - go to System DSN tab then click Add
         - you will be prompted to select a driver, choose "Microsoft dBase driver (*.dbf)" then click "Finish"
         - setup wizard will appear
         *Note : Specify a "Data Source Name" and of course disable "Use Current Directory" then click "Select Directory" and locate where the database file is located.

    2.  Configure data source on CF Administrator.
         - I will assume that you will already know what to do in here.  Just let me know if need some assistance.
         *Note : Be sure that you will use an ODBC socket for your driver and of course the "ODBC DSN" is the system DSN that you've created on step 1.

    3.  Create a simple query on your cfm file.
         - Selecting records then display
           <cfquery name="qGetRecord" datasource="DSN">
             Select * From Tablename
           <cfoutput query="qGetRecord">
             #currentrow#. #price# <br> <!--- And so on and so forth ... --->

    :: Reminders ::
       a.  If the database file is located on another PC within the network then the root folder must be shared.
       b.  Since shared database, the server machine will have to "map drive" the shared folder.  Take note the drive since this will be needed on configuring the System DSN on step 1.
       c.  Be sure to verify the data source created on step 2 to avoid errors during running queries on your .cfm files.

    Hope this helps you.  Just try it then let me know the result.

    eNTRANCE2002 :-)
    LVL 1

    Author Comment

    Thanks eNTRANCE2002,

    I will let you know in the near future what becomes of this - your instructions are hard to mess up!  Great job and if this works the points are yours!
    LVL 14

    Expert Comment

    by:Renante Entera
    Hi scripkilla!

    Just keep me updated regarding this matter.  And of course, I will assist you on solving this problem.

    eNTRANCE2002 :-)
    LVL 14

    Expert Comment

    by:Renante Entera
    Hi mrichmon!

    Maybe, you can evaluate my comment since you're one of the EXPERTS on this TA.  Then probably, you can decide whether it helps or not.

    But I think it deserves to be accepted 'coz I'm guiding the asker on the right track.  Am i right ???

    eNTRANCE2002 :-)

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now