450 likes | 693 Views
Client/Server Database Tutorial. 1. SQL Server Connection through MS Access. Remote SQL server connection Through ODBC System DSN. Your SQL Database created by DBA. FACBUSAD1 SQL server. User authentication using your user name and password. MGD B106 Computer or your own PC.
E N D
SQL Server Connection through MS Access Remote SQL server connection Through ODBC System DSN Your SQL Database created by DBA FACBUSAD1 SQL server User authentication using your user name and password MGD B106 Computer or your own PC Export / Link You can create your own database On Access MS Access Save Backup accdb file on disk
SQL Server Connection through MS Access • Empty database created by DBA on SQL server site • At client site, create ODBC System DSN for SQL server connection • Design Access database at client site • Export tables from Access client to SQL server • Dynamic link Access to ODBC SQL server database
DBA creates your database on SQL server site • FACBUSAD1 Server: (facbusad1.mcmaster.ca) • Assume your email box name is johndoe and your student ID is 0123456 • Database Name in SQL Server of FACBUSAD1: johndoe (email box name) • Database Login ID: johndoe (email box name) • Database Log Password: 0123456 (Student ID) • Data Source Name (DSN): ODBCjohndoe (ODBC + email box name)
Creating ODBC Connections via Windows Control Panel • Control Panel > Administrative Tools > Data Sources (ODBC) • ODBC setting is installed in the computer. When you change to another computer, you have to set it up again or copy file
Creating DSN File DSN System DSN
Specify your Login ID (your mac email name) and password (your student ID#)
Finish DSN File DSN System DSN
Export and Link ODBC • Create a access database • Export it to your SQL server • Link SQL server database to your Access db • Manipulate SQL server database from Access db
SQL Server Upsizing • Access 2007 has feature called SQL Server Upsizing Wizard • Allows exporting and linking of all tables to SQL Server • Allows triggers to keep autonumber fields functioning, and maintains relationships between tables
Select ODBC Data Source File DSN System DSN Save your File DSN in your Q drive so you can use it anywhere
Login SQL server using your mac email name and your student ID #
Other ways to Create SQL Tables • Export a table to ODBC Database • Export all tables to ODBC Database • Both have same import method
Other ways to Link SQL Tables • Open ODBC Database instead of Access db • Import ODBC Database • Both have same import method
Managing database on SQL server • Using linked tables you can update data stored on SQL server using MicroSoft Access • You can also design and run forms and reports on Access • However, you cannot drop tables on SQL server through Access
http://facbusad1.mcmaster.ca/users/ap1/yuanyuf/drop_table.asphttp://facbusad1.mcmaster.ca/users/ap1/yuanyuf/drop_table.asp
MicroSoft SQL Server • SQL Server registrationlocal and remote servers • SQL Server security controlWindows NT authenticationSQL user authentication • Restore and Backup • Import and export
SQL Client/Server Connection Remote SQL server registration Your database created by DBA FACBUSAD1 SQL server User authentication using your user name and password MGD B106 Computer or your own PC Import/export You create your own database Local SQL server Backup/restore Local SQL server registration Backup disk
Suggested Flower Store Tables for Assignment 3 Customers (Customer_Name, Password, Address, Phone_Number) Products (Product_Code, Product_Name, Unit_Price) Orders (Order_Number, Customer_Name, Order_Date, Recipient_Name, Recipient_Address, Creadit_Type, Creadit_No, Expire_Date ) Orderln (Order_Number, Product_Code, Quantity) Usage (Product_Code, Occasion)