• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

OLE DB connection. Where to start?

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?  
3 Solutions
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
db.open "DSN=[DSNName];uid=;pwd="

for oledb, you might be able to use (but i'm not sure)

db.open "Driver={Microsoft dBase Driver (*.dbf)};DefaultDir=[directorypath];uid=;pwd="
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: http://www.connectionstrings.com) 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

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
Given as well, "Where do I start?" as part of the question, generalities tutorials and suggestions are good.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now