Solved

Joining 2 dbase databases using SQL

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

708 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

11 Experts available now in Live!

Get 1:1 Help Now