When the subquery fails to find a matching row in tbl B, the subquery returns NULL.
But since the UPDATE has no WHERE clause, it will update all rows, even those where the subquery returns NULL.
The first step in setting up a linked table is to navigate to the Linked Tables dialog in Access.
Thus far in this tips series on Access and SQL Server, we have created an ODBC Data Source Name (DSN) using the OLEDB driver for connecting to SQL Server 2000, as well as a System DSN to connect to a SQL Server 2005 instance using the new SNAC (SQL Native Client) driver.
This was in preparation for using Microsoft Access as a front-end tool for a SQL Server 2005 database.
For the purpose of this tip however, we're going to focus exclusively on Microsoft SQL Server.
The process from this point forward is compatible with all releases of SQL Server since version 7.0.
Though Access can be considered a sub-par application by the relational database elitists, it can be a very capable alternative for querying data from SQL Server without the learning curve associated with Visual Studio.
works fine when I try to update all the records in tbl A, however, in this case I only have missing data which I have identified and populated in tbl B.When I try to update only the missing data the non-matched data is also updated but to NULL. The reason some of your rows are getting NULLs updated is due to the subquery.Consequently, to prevent this, you might do this: One potential issue may arise when the subquery actually finds more than one matching row in tbl B.If this happens, the UPDATE will terminate with an error ("subquery may return only one row").
This table is a pointer to a table in a SQL Server database that is associated with a pre-defined System ODBC Data Source Name (referred to as a DSN from this point forward).
In truth, you have many options for setting up Linked Tables from Access; many RDBMSs (Relational Database Management Systems) and Microsoft Office applications for example - even Share Point and Outlook are options for linking tables back to Microsoft Access.