Solved

Access ODBC connection and relations in MySQL

Posted on 2004-04-11
3
252 Views
Last Modified: 2012-05-04
I have made a good connection from Access to a mySql database. I can put an Access form over a table in MySql, which gives me the opportunity to create, update, delete records in the MYSQL table perfectly. However the relations between the tables in the Mysql database are, if you look in the records, made by comma seperate values??

For example an employee can work in the building a to z. The actual buildings he is working in are written in the "building" field as i.e. A, D, G, Z. The tabel building contains the buildings details.

Is this the way Mysql is controlling relations or is this bad programming of the guy who made the (interactive) website (PHP) on top of this MSQ database ??
How can I tell Access that in this case a relation exists of an employee with building A,D,G,Z. Access sees only a field with comma seperate text??

With kind regards,

Pmagistra
0
Comment
Question by:Pmagistra
3 Comments
 
LVL 8

Accepted Solution

by:
jb79uk earned 250 total points
ID: 10801799
This sounds like a design choice by the creator of the database.  The alternative would be to have separate table to contain the relationships.

To get a recordset of the buildings each employee is related to, I'd do something like this:

SELECT BuildingTable.*, EmployeeTable.* FROM EmployeeTable INNER JOIN BuildingTable ON EmployeeTable.Building LIKE "*" & BuildingTable.ID & "*"

As I don't know the names of all the fields and tables involved this is only example SQL, but if you substitute the correct names it should work.
Replace:
'BuildingTable' with the name of the Buildings table
'EmployeeTable' with the name of the Employees table
'ID' with the name of the field in the Buildings table which contains the single letter code (A,B,C etc)

Hope this helps

JB
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

758 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

24 Experts available now in Live!

Get 1:1 Help Now