Solved

Access ODBC connection and relations in MySQL

Posted on 2004-04-11
3
265 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
[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
3 Comments
 
LVL 8

Accepted Solution

by:
James Bendall 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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.

734 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