Chapter 37: SQL Server as an Access Companion
1217
This is the script used in Figure 37.17:
USE NORTHWIND
INSERT INTO Employees
(LastName, FirstName, Title)
VALUES
(‘Goode’, ‘Johnny B’, ‘Sales Representative’)
SELECT * FROM Employees
After running this short SQL script in SQL Server and pressing F5 in Access to refresh the data-
sheet view of dbo_Employees (or closing and re-opening the table), dbo_Employees now
shows the record just added in SQL Server (see Figure 37.19).
FIGURE 37.19
SQL Server changes are automatically reflected in linked Access tables.
The imported SQL Server table (dbo_Employees1) does not contain the new record added to
SQL Server. The table would have to be re-imported from SQL Server, or code could be used to
search for records present in SQL Server but not in Access.
Views
Another object used in SQL Server databases is called a view. A view is really a stored query that
joins tables and filters data. Essentially, when you create a form in Access, you’re creating a query
behind that form. A SQL Server view object creates a table-like object based on a SQL statement