Solved

Access ODBC connection and relations in MySQL

Posted on 2004-04-11
3
258 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

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