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

Joining 2 dbase databases using SQL

Can anyone tell me how to do this properly?  I have 2 dbase databases in the same directory.  I want to use SQL to join them on a common field.  The following code works fine if I use it on 2 tables in a microsoft access database, but won't work with dbase databases

dim db as Database
dim Rs as recordset
dim SQL as String

SQL = "Select * from one, two where one.id = two.id"
set db = openDatabase("C:\directory",true, true,"dbase IV")
Set rs = db.openRecordSet(SQL,dbOPenDynaSet)

'This code assumes one and two are two dbase databases stored in the same directory.

Anyone know how to do this?
0
ssteeves
Asked:
ssteeves
  • 2
1 Solution
 
cymbolicCommented:
If not there already, try creating an index on the fields to be joined.  In some cases, I have had to import the dbf's into access, create appropriate indexes in both tables, then perform the join on the imported tables.  One of the problems in using .dbf files in Access is its own weakness when multifield indicies are used, particularly when they consist of large character fields.  Another problem is that .dbf fields are often loosely or inappropriately typed, such as when the developer uses a text field to store dates, rather than using a Date type field, etc.
0
 
ssteevesAuthor Commented:
That didn't seem to solve the problem.  We don't want to have the databases in Access.  Once we import them and create an index, we can't export them back to dBase again.

However, we have decided not to worry about this problem, so we are no longer looking for an answer.  Thanks anyway for your help.
0
 
ssteevesAuthor Commented:
I figured out the problem.  It was kind of annoying, but our dbase databases started with a numeric character, and the program didn't like it.   Thanks for your help anyway.

Anyone know how to delete a question without giving out the points?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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