Why does linked view give different results from MS Access vs SQL Manager?

前端 未结 2 2058
轮回少年
轮回少年 2021-01-18 23:12

I created a view on SQL Server 2000 and linked the view to my Access 2007 database via ODBC. Opening the view from Access showed what looked like a duplicate value. I update

2条回答
  •  长发绾君心
    2021-01-18 23:57

    You don't need all the 8 tables linked in Access...the view is enough, Access doesn't need to know about the underlying tables.

    I think you have a different problem, I experienced similar issues like yours as well.
    When I link a SQL Server view in Access via ODBC, a window pops up that wants me to select a unique identifier (read: primary key) from the columns in the view:

    If I don't select anything (or some wrong columns, which do not identify a unique record), Access screws up the displayed data like in your example.
    Apparently Access is not able to display the view correctly without a unique identifier.

    Solution for your problem:
    As I understand your view, the id is unique, right?
    If yes, just delete the view, re-link it via ODBC, and when the "select unique identifier" window pops up, you need to select the id column.

提交回复
热议问题