Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access ODBC connection and relations in MySQL

Posted on 2004-04-11
3
Medium Priority
?
273 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 1000 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

Technology Partners: 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

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.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 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