Download presentation
Presentation is loading. Please wait.
Published byHarold Bruce Modified over 9 years ago
1
ODBC REPORTS How to Use Access to work with MS SQL Server Database
2
Open This folder
3
Open Access
4
Open a blank database
5
Give the DB an appropriate name.
6
Open the External Data menu
7
Click on the ODBC Database ODBC stands for Open Database Connectivity ODBC is Microsoft's strategic interface for accessing data in a heterogeneous environment of relational and non- relational database management systems.
8
Click on this button. This gives an active link with the Microsoft SQL Server database. Any changes made in Access will be reflected in the SQL Server database.
9
A new DSN (data source name) Name has to be created.
10
1. In this example it is: Oasis Instance Link. You can choose any name you like. 2. Click on New
11
1. Scroll down and choose SQL Server 2. Click Next
12
1. Once again I chose Oasis Instance link. 2. Click Next
13
Click Finish
14
1. I have described the data source as Oasis 2. The server is alar\oasis 3. Click Next
15
2. Click Next 1. Use Windows NT Authentication
16
Choose your database as the default.
17
Click Next
18
Click Finish
19
Test the Data Source
20
2. Click OK 1. The result should read like this.
21
Click OK
22
1. You are now returned to the ODBC data source window. Scroll through and choose the link to Oasis. In this example I set it up as Oasis Instance Link. Click OK
23
The tables from the default database should now appear.
24
1. I highlighted the four tables I wanted to use. Click OK
25
These four tables now appear in Access. 1. Table 1 can be deleted. 2. Click on Database Tools.
26
The relationships between the tables now have to be established
27
All tables are highlighted. Add the tables to the Relationship window.
28
The relationships between the tables are now established
29
Once the relationships are established, queries can now be created. A query will be created in order to produce a report.
30
Select the query wizard.
31
Close this window.
32
Right Click on Query 1 and select the SQL view.
33
This is the SQL view
34
SELECT c.CustomerNumber, c.CustomerLastName, iln.InvoiceNumber,i.SaleDate,sum(iln.QuantitySold * inv.SellingPrice) as Total from dbo_CUSTOMER c, dbo_INVOICE i, dbo_INVOICE_LINE_ITEM iln, dbo_INVENTORY inv where c.CustomerNumber = i.CustomerNumber and i.InvoiceNumber = iln.InvoiceNumber and iln.InventoryNumber = inv.InventoryNumber GROUP BY iln.InvoiceNumber, c.CustomerNumber, c.customerlastname,i.SaleDate ORDER BY c.CustomerNumber, iln.InvoiceNumber I want to produce a Sales Report Notice the ‘dbo’ in front of each table name. The actual names of each table are preceded by ‘dbo’
35
The SQL is structured in the same manner as SQL SERVER To run the query
36
This query will now be used to generate a report using the Report Wizard.
37
Click on the Create Menu.
38
2. Run the Report Wizard. 1. Save the query
39
All lines will be selected. Click Next
40
A grouping by CustomerNumber
41
No sorting since the SQL already pre-sorted the query.
42
Stepped lay out
43
The name of the report.
45
Click on the Design View to change the format of the report.
47
I want to create a Sales Invoice
48
Notice the concatenation. Access uses ‘&’ instead of CONCAT
50
The initial report looks like this.
51
Original Design View
52
The New Design View
53
The Invoice
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.