Re: Access 2007: Creating a local relationship between two remote ODBC tables



On Jan 22, 5:54 am, "Richard@Home" <richardath...@xxxxxxxxx> wrote:
On Jan 11, 9:50 pm, "David W. Fenton" <XXXuse...@xxxxxxxxxxxxxxxxxxx>
wrote:





"Richard@Home" <richardath...@xxxxxxxxx> wrote innews:7b8f1996-fce6-44ba-8c06-2f09c6193242@xxxxxxxxxxxxxxxxxxxxxxxxxxx
m:

To make it easier for them to create their custom queries and
reports I need to populate the access front end relationship
diagram so that when they create new queries, the tables they add
will be linked together correctly in the query gui.

Two points:

1. you can add non-enforced "relationships" in the relationship
designer that serve no purpose other than defining default joins
between tables.

2. in the QBE, any two tables that have the same field name in both
and appropriate indexes will be joined automatically. My suspicion
is that the MySQL db you're using doesn't use the same name for the
FK as it does for the PK it's related to.

In any event, just define the relationships in your front end and
they'll make building queries easier, which, it seems to me, is what
you're looking for.

--
David W. Fenton                  http://www.dfenton.com/
usenet at dfenton dot com    http://www.dfenton.com/DFA/

I've used the CakePHP naming convention which looks like this:

tables names are plural
primary key is 'id'
foreign key is singlular_table_name_id

for example:

"articles" table
id INT (PK)
name VARCHAR(128)
user_id INT (FK to users->id)

I can (and have) written code to read the fields and work out what
points to what, its the creating of the relationships that fails.

In a nutshell, I'm after the code that will create the local
relationship diagram, which I can do manually without generating the
error "Cannot create a relationship on linked ODBC tables."

The important thing here is that I'm not trying to create the
relationships in the MySQL backend (the backend is irrelevant tbh),
I'm trying to create it in the front end.- Hide quoted text -

- Show quoted text -

Wow that breaks EVERY naming convention rule I have ever seen. Im not
saying it is eitehr right or wrong but it is convoluted.

Table names should be singular. A Client table defines a Client not a
Clients.

Never repeat a field name across your database EXCEPT in PK/FK
situations. "ID" for all PKs is not very good. The PK in the client
table should be named ClientID. That should also be used for the FK
for all tables linked to the Client table.

Make thinsg a LOT easier to link and build relationships.
ClientTypeID in the ClientType table is linked to ClientTypeID in the
Client table.

Again it may not be eitehr right or wrong but its a lot cleaner and
intuitive.
.



Relevant Pages

  • Re: Can I AutoSize (or Fit) merged, variable data within a text bo
    ... for the messages as these are created through the queries in the background. ... message" directly in a small font, each designed to fit the text. ... The problem became a problem when my client decided that they no longer ... PrintShop Mail is made for this kind of gig but it's ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Performance Improvements: Hardware vs. DB Design
    ... > I recently designed & developed a data warehouse for a client of ours. ... > database with a substantial amount of data, ... I think many companies are inclined to add more server ... the queries, revise the indexes if necessary, and verify the reporting ...
    (microsoft.public.sqlserver.server)
  • Re: Can I AutoSize (or Fit) merged, variable data within a text bo
    ... If you are getting the texts through queries, you may be able to get the ... message" directly in a small font, each designed to fit the text. ... needed to change these to my PrintShop Mail software. ... The problem became a problem when my client decided that they no longer ...
    (microsoft.public.word.mailmerge.fields)
  • Re: When does BIND send queries with DO flag enabled?
    ... client workstations are XPSP3, and NONE of the queries coming from those ... DNSSEC capable. ... please get the broken firewall fixed! ...
    (comp.protocols.dns.bind)
  • Re: Speed problem
    ... only at one client, their several invoices, etc. ... However, on the network, some things are happening at ... they do bring together a buncha tables via queries). ... mostly on the terminals). ...
    (comp.databases.ms-access)