Solved

Joining 2 dbase databases using SQL

Posted on 1998-07-10
3
191 Views
Last Modified: 2013-11-24
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
Comment
Question by:ssteeves
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
cymbolic earned 50 total points
ID: 1465454
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
 
LVL 1

Author Comment

by:ssteeves
ID: 1465455
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
 
LVL 1

Author Comment

by:ssteeves
ID: 1465456
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

740 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