OLE DB connection. Where to start?

Posted on 2005-04-14
Last Modified: 2013-11-25
I have an some dbf tables (VB 5 I think) that are a part of a custom written application.  I need to be able to setup a live connection between the dbf file and MS Outlook so I can view names and addresses and possibly edit some of the data in the fields.  The tables will need to be acessible from Outlook and my custom app at the same time.  The primary purpose is to view the data and not modify it.  Where do I start?  Is this going to be complicated?  
Question by:pauljnye
    LVL 8

    Accepted Solution

    it may be easier to use ODBC. you can create an ODBC DataSource Using the Microsoft dBase Driver (*.dbf). Point it to the directory the files are in. then add Microsoft ActiveX Data Objects Reference to your project. then use

    Dim db as New ADODB.Connection "DSN=[DSNName];uid=;pwd="

    for oledb, you might be able to use (but i'm not sure) "Driver={Microsoft dBase Driver (*.dbf)};DefaultDir=[directorypath];uid=;pwd="
    LVL 29

    Assisted Solution

    LVL 5

    Assisted Solution

    For what I have heard, ODBC connections are slow. Unfortunately, I can't tell this from my own experience. I do believe that, in order to setup a DSN runtime, you need administrator rights. I doubt that every end user has these rights. Otherwise this DSN needs to be setup manually. In practice, this means that some system administrator would have to come to set up the connection according to your DSN specifications that you provide.

    Another option is to declare an ADO connection and set its connectionstring (source: as follows:

    Dim objMyConn As ADODB.Connection

    Set objMyConn = New ADODB.Connection
    objMyConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\MyDBFolder\MyDatabase.dbf;Extended Properties=dBASE IV;User ID=Admin;Password="

    'Do things with your connection here

    Good luck,

    Luc Derckx
    LVL 5

    Expert Comment


    We posted possible solutions on how to establish a connection with a DBase database. Allthough the solutions provided are different, I believe that one of them would've worked. We did abandon giving pauljnye examples on how to get a list of contacts for example. We also abandoned in mentioning where the outlook database can be found, but I don't think I'm speaking for myself when saying that we had the general idea that pauljnye already knew where the database could be found.

    I also believe that pauljnye wasn't specific enough when she asked for help. I believe we may have posted solutions to all possible things that can be done with an outlook database before scoring bull's-eye. I therefore believe that pauljnye should've stuck to this topic to ask for more specific information once pauljnye had the connection working.

    I therefore recommend to split points between the three of us. I believe a solution has been provided in telling pauljnye how to establish a connection and that all of us would've dived into the subject as soon as pauljnye would ask for more specific info.


    Luc Derckx
    LVL 6

    Expert Comment

    Given as well, "Where do I start?" as part of the question, generalities tutorials and suggestions are good.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

    730 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

    16 Experts available now in Live!

    Get 1:1 Help Now