Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568

    Help with relationships beetween FE and BE

    Hi Experts,



    i have huge problem and a little time to fine the solution.

    I am trying to recreate split FE-BE split database on Access on FE Access and BE MS SQL Server.

    In MS SQL Server i recreated RI from Access BE. And seems to be working. On FE on Access I can not see relationships but it is normal.

    I will explain my problem on examples.
    In attachment you can find 2 examples of my databases:
    Working:
    Simple split databases created on Access.
    Click image for larger version. 

Name:	working example.png 
Views:	13 
Size:	26.9 KB 
ID:	32228

    I have created here relationships, one query (NowaOby) and one form.


    When you check form tbl_Korekty you can see that i can possibility to write new record within my NowaOby query.

    And it is fine here. I need have this possibility in order to have working database model.

    Not Working:
    Instead of linking to MS SQL Server i want to demonstrate what is not working on linked Excel files

    I created relationships (the same as i can create when MS SQL Server tables are linked):

    Click image for larger version. 

Name:	RI  NOT working.PNG 
Views:	13 
Size:	15.9 KB 
ID:	32232

    Within my NowaOby query there is no possibility to add new records:

    Click image for larger version. 

Name:	new records.PNG 
Views:	13 
Size:	15.6 KB 
ID:	32233


    Of course here is an Excel linked tables and i can not add new records. But what if I have MS SQL Server. It should be possible somehow.
    Attached Thumbnails Attached Thumbnails NOT working example.png   RI working.PNG  

  2. #2
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Relationships for working database look like:

    Click image for larger version. 

Name:	RI working.PNG 
Views:	14 
Size:	14.8 KB 
ID:	32234

    Please help with topic,

    How to recreate the behaviour for FE-BE Access into FE Access - BE MS SQL Server?

    thank you in advance,
    Best Wishes,
    Jacek
    Attached Files Attached Files

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Using linked Excel files was a bad analogy - as you already know those cannot be updated in Access.
    This is due to a copyright issue dating back about 25 years!

    However, as long the SQL tables are updatable in SQL Server, they will also be updatable as linked tables in Access

    The relationships aren't really relevant in this context
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Do your SQL tables have primary keys? If you open the tables in Access in design view do you see the same primary keys like in the Access version?

    Cheers,
    Vlad

  5. #5
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Hi Guys!

    Thank you very much!

    ridders52,
    This is due to a copyright issue dating back about 25 years!
    wow microsoft is strange

    However, as long the SQL tables are updatable in SQL Server, they will also be updatable as linked tables in Access
    How can i recreate my query from sample database from Access in MS SQL Server? Create View and try to insert values into it?

    The relationships aren't really relevant in this context
    Question, what is very important here?

    Vlad,
    Do your SQL tables have primary keys? If you open the tables in Access in design view do you see the same primary keys like in the Access version?
    Yes Vlad, the primary keys are the same. I will create new sample database in MS SQL Server and publish it here in order to replicate the bahavior.

    You can also replicate the bahavior from here by your own. All what you have to do is create 2 tables in MS SQL Server: tbl_Daty and tbl_Korekty and link it with SQL Server.
    Fields you can find in Excel files.

    Thank you once again,
    I really appreciate any help here,
    Jacek

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    wow microsoft is strange
    True but in this case they were the subject of a lawsuit - its probably expired by now but the functionality has never been restored

    Question, what is very important here?
    The tables must be updatable in SQL Server - so they MUST have a PK field.
    This also applies to SQL views in Access - IF they have a PK they can be updated in Access

    I've looked at the Access database you supplied and added data to both tables then edited it.
    Editing tbl_Daty depends on 2 required fields being present in tbl_Koretky
    As long as tbl_Koretky is completed first then tbl_Daty there is no problem
    I've not tried to do so in SQL Server but as long as the sequence is the same, it should be fine
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Jacek,

    Can you update the tables in SQL server? Is the SQL user account used in your connection the db_owner or at least db_datawriter?
    https://docs.microsoft.com/en-us/sql...se-level-roles

    Cheers,
    Vlad

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Jacek

    Have a look at this link https://accessexperts.com/starthere/
    It has loads of articles about using Access with SQL Server by Access MVP Juan Soto
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  9. #9
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank You Guys,

    ridders52,
    you have right that first you should fullfill tbl_Korekty and next tbl_Daty.

    But when you are working on Access only your query is editable and you can input data ! You have cursor and can input data buty there will be warning about necessary fields.
    Working on MS SQL Server has no possibility to do that.

    This is strange! Very! So I have to rebuild my model and i think something is not ok with this.
    It should work exactly in the same way as in Access.

    Vlad,
    yes i cna update tables and have specific access to ms sql server.

  10. #10
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    I think Guys that here is problem connected with seeing tables by Access.

    When Access is based on Access split database there is no problem.
    But when tables are linked to MS SQL Server there is very slighty difference.

    I had to find workaround and implement it into my database.
    Added one additional field done the job.

    I added tbl_Daty primary key field into NowaOby query and Korekty_ID field and it is working now.
    I think that Access has to see exactly what primary key is in specific table when you are linking tables from ms sql server.

    Best Wishes,
    Jacek

  11. #11
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    When you link a SQL table in Access , if Access can't determine a unique key field, it will prompt you to set one or a combination of fields to make a unique reference to the records.
    Without this you won't be able to edit the records. This is intended behaviour.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  12. #12
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Hi Minty,

    thank you.
    Here i Have Primary keys moved from MS SQL Server to FE Access.
    But still Access has problem identify some of them within queries.

    Jacek

  13. #13
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    If you delete the link to the SQL table and recreate it, ensuring the Primary key is identified that problem should disappear.
    Sometimes the upsizing wizards don't necessarily do this correctly.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  14. #14
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank you Minty,

    problem is still there after recreating linked tables.

    Jacek

  15. #15
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    That's a bit odd. Do you have the correct permissions set on the tables in SQL ?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 08-05-2016, 11:53 AM
  2. Replies: 2
    Last Post: 07-27-2016, 10:25 AM
  3. Help with Relationships
    By indians207 in forum Database Design
    Replies: 7
    Last Post: 11-25-2013, 09:53 AM
  4. Explicit Relationships and Implicit Relationships
    By Dazza666 in forum Database Design
    Replies: 2
    Last Post: 07-17-2013, 02:11 AM
  5. Too Many Relationships
    By MikeT in forum Database Design
    Replies: 4
    Last Post: 08-25-2010, 07:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums