280 likes | 480 Views
Database & Server-side Scripting. Tutorial 10. Creating Database. Microsoft Access Example Create a blank database Create a table in database. Creating Database . Setting attribute. Creating Database. Setting primary key. Query Database. Query Database - Design View.
E N D
Database & Server-side Scripting Tutorial 10 ine1020 Introduction to Internet Engineering
Creating Database • Microsoft Access Example • Create a blank database • Create a table in database ine1020 Introduction to Internet Engineering
Creating Database • Setting attribute ine1020 Introduction to Internet Engineering
Creating Database • Setting primary key ine1020 Introduction to Internet Engineering
Query Database ine1020 Introduction to Internet Engineering
Query Database - Design View ine1020 Introduction to Internet Engineering
Query Database – Design View ine1020 Introduction to Internet Engineering
Query Database – SQL ine1020 Introduction to Internet Engineering
Application or Browser ADO OLE DB ODBC Relational data sources Mainframe/legacy data Non-relational data sources Database Access • Microsoft Universal Data Access (UDA) • Easy to use programming interface • Access for relational & non-relational database ine1020 Introduction to Internet Engineering
Application or Browser ADO OLE DB ODBC Relational data sources Mainframe/legacy data Non-relational data sources Database Access • OLE DB (Object Linking and Ebedding DB) • Open specification • Core architecture ine1020 Introduction to Internet Engineering
Application or Browser ADO OLE DB ODBC Relational data sources Mainframe/legacy data Non-relational data sources Database Access • ODBC (Open Database Connectivity) • Access data from a variety of DBMS through a single interface ine1020 Introduction to Internet Engineering
Application or Browser ADO OLE DB ODBC Relational data sources Mainframe/legacy data Non-relational data sources Database Access • ADO (ActiveX Data Objects) • Ease to use, high performance, low memory overhead ine1020 Introduction to Internet Engineering
Registering a Database • Specific instructions for Windows 98/2000/XP: • double-click the ODBC Data Sources (32 bit) icon in the Windows Control Panel to display the ODBC Data Source Administrator dialog. - Click the System DSN tab to view a list of all systems DSNs. - Select the name to the right of Microsoft Access Driver (*.mdb) from the list. ine1020 Introduction to Internet Engineering
Registering a Database • Click Add… to display the Create New Data Source dialog. Select Microsoft Access Driver (*.mdb) and click Finish to display the ODBC Microsoft Access Setup dialog. ine1020 Introduction to Internet Engineering
Registering a Database • Enter the Data Source Name and Description field. Click the Select… button to display the Select Database dialog. Select the database that you want. Click OK to close this dialog. ine1020 Introduction to Internet Engineering
Registering a Database ine1020 Introduction to Internet Engineering
Registering a Database • The Banking DSN is now listed. ine1020 Introduction to Internet Engineering
Active Server Pages (ASP) • Server-side scripting • ASP file contains HTML and scripting code • VBScript de facto language for ASP scripting • Other languages can be used • JavaScript • .asp file extension • Send dynamic Web content • HTML • DHTML • ActiveX controls • Client-side scripts • Java applets ine1020 Introduction to Internet Engineering
Active Server Pages (ASP) • ASP requires • Web server • Personal Web Server (PWS) • Internet Information Server (IIS) • How ASP works ? • Client sends request • Server receives request and directs it to ASP • ASP processes, then returns result to client • Server processes ASP file • Parsed (top to bottom) by ActiveX component asp.dll • Parsed each time requested • Web server must support ASP by providing component such as asp.dll ine1020 Introduction to Internet Engineering
Active Server Pages (ASP) • ASP has several built-in objects • Request object • Access information passed by HTTP GET or POST • Used to access cookies • Response object • Sends information such as HTML or text to client • Server object • Provides access to server methods and properties • Provides method CreateObject • Used to instantiate other objects ine1020 Introduction to Internet Engineering
Active Server Pages (ASP) • Scripting delimiters • <% and %> • Indicate code is to be executed on server, not client • @LANGUAGE • Specify scripting language (default VBScript) • <% @LANGUAGE = “VBScript” %> • Each time page refreshed, server loads and interprets ASP ine1020 Introduction to Internet Engineering
ASP/ADO Data.html <HTML> <HEAD> <TITLE>Sample Database Query</TITLE> </HEAD> <BASEFONT FACE = "ARIAL,SANS-SERIF" SIZE = 2> <FONT SIZE = +2> <STRONG>Querying an ODBC database.</STRONG> </FONT><BR> <FORM METHOD = "POST" ACTION = "data.asp"> <INPUT TYPE = "TEXT" NAME = "QUERY" SIZE = 40 VALUE = "SELECT * FROM Info"><BR><BR> <INPUT TYPE = "SUBMIT" VALUE = "Send Query"> </FORM> </BODY> </HTML> ine1020 Introduction to Internet Engineering
ASP/ADO Data.asp ine1020 Introduction to Internet Engineering
ASP / ADO ine1020 Introduction to Internet Engineering
Dreamweaver MX • Database Window ine1020 Introduction to Internet Engineering
Dreamweaver MX • Recordset ine1020 Introduction to Internet Engineering
Dreamweaver MX • Server Behaviors • Repeat regions • Dynamic text ine1020 Introduction to Internet Engineering