Solved

Joining 2 dbase databases using SQL

Posted on 1998-07-10
3
184 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
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 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