Basics of Web database - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Basics of Web database

Description:

... (such as C , Python, Perl, or Java) accessed through the Common Gateway ... When programming to interact with ODBC you only need to talk the ODBC language. ... – PowerPoint PPT presentation

Number of Views:91
Avg rating:3.0/5.0
Slides: 22
Provided by: francisj4
Category:

less

Transcript and Presenter's Notes

Title: Basics of Web database


1
Basics of Web database
  • With the advent of Web database technology, Web
    pages are no longer static, but dynamic with
    connection to a back-end database.
  • Web sites are now able to display updated
    information on-the-fly and support user
    interactivity.
  • One can use the same page to display information
    of thousands of products in a database.

2
Three tiers of Web database
  • To build a Web database, usually we need to use
    a three-tier model
  • Web server
  • Web application server (middleware), and
  • Database

3
How a user interacts with a Web database
  • From a Web browser, a user submits a request to
    the Web server.
  • The Web server passes it onto the middleware
  • The middleware writes the request in SQL queries
    and sends it to a back-end database.
  • The data retrieved are handed back to the
    middleware

4
How a user interacts with a Web database
  • 5. The middleware generates a Web page for the
    data
  • 6. The Web server sends the Web page to the
    browser
  • 7. The browser displays the Web page to the user

5
Web database connectivity
  • Web-database connectivity takes several different
    forms
  • CGI scripting A custom application is developed
    using a traditional programming language (such as
    C, Python, Perl, or Java) accessed through the
    Common Gateway Interface (CGI).
  • Application server Such as ColdFusion or ASP,
    which works with the Web server that can
    communicate with databases through ODBC

6
ASP Middleware for Windows platform
  • ASP stands for Active Server Pages
  • ASP is a programming environment that gives the
    ability to generate dynamic html pages with the
    help of server side scripting.
  • VBScript is the default scripting language for
    ASP

7
ASP Middleware for Windows platform
  • An ASP page is almost the same as a HTM or HTML
    page... the only difference is that an ASP page
    has the '.asp' extension
  • Active Server Page can include both client side
    and server side scripts.
  • In an ASP page VBScript is usually used as the
    server side and Java Script as the client side
    scripting language

8
Special software needed to write ASP?
  • You don't need any special software to write an
    ASP page.
  • An ASP page can be written with any HTML
    editor... even in Windows Notepad.
  • If you are looking for some special software to
    write an ASP page, Microsoft Visual InterDev is
    the best tool for you.

9
Special software needed to write ASP?
  • InterDev helps you to easily develop ASP
    applications because it simplifies the process of
    developing and debugging ASP applications
  • ASP is browser independent because all the
    scripting code runs on the server and the browser
    only gets a normal HTML page as a result of
    server side scripting.

10
ASP compatibility
  • ASP is an engine/program built into Internet
    Information Server (IIS) / Personal Web Server
    (PWS)
  • PWS is a smaller - but fully functional - version
    of IIS
  • To run IIS you must have Windows NT 4.0 or later
  • To run PWS you must have Windows 95 or later

11
What is an ASP file?
  • An ASP file is just the same as an HTML file
  • An ASP file can contain text, HTML, XML, and
    scripts
  • Scripts in an ASP file are executed on the server
  • An ASP file has the file extension .asp

12
How does it work?
  • When a browser requests an HTML file, the server
    returns the file
  • When a browser requests an ASP file, IIS/ PWS
    passes the request to the ASP engine
  • The ASP engine reads the ASP file, line by line,
    and executes the scripts in the file
  • Finally, the ASP file is returned to the browser
    as plain HTML

13
What can be done with ASP
  • Dynamically edit, change or add any content of a
    Web page
  • Respond to user queries or data submitted from
    HTML forms
  • Access any data or databases and return the
    results to a browser

14
What can be done with ASP
  • The advantages of using ASP instead of CGI and
    Perl, are those of simplicity and speed
  • Provides security since your ASP code can not be
    viewed from the browser
  • Since ASP files are returned as plain HTML, they
    can be viewed in any browser

15
A sample ASP script
  • ltHTMLgt
  • ltHEADgt ltTITLEgtHello Worldlt/TITLEgt
  • lt/HEADgtltBODYgt
  • lt
  • ' This will print to the browser the 
  • ' words Hello, ASP World.
  • response.write "Hello, ASP World!"
  • gt
  • lt/BODYgtlt/HTMLgt

16
ASP and database server
  • To interact with a database, you usually have to
    add code that talks to a particular database
    using a proprietary language.
  • If you want your program to talk to an Access,
    FoxPro and Oracle databases you have to code your
    program with three different database languages.

17
ASP and database server
  • When programming to interact with ODBC you only
    need to talk the ODBC language.
  • The ODBC Manager will figure out how to contend
    with the type of database you are targeting
  • All that you need to do is have installed an ODBC
    driver that is specific to the type of database
    you will be using.

18
ODBC/DSN
  • ODBC stands for Open Database Connection (or
    Connectivity). 
  • ODBC makes it easy to create ASP scripts that
    will connect to a database. 
  • Normally, each ODBC will have a DSN (Data Source
    Name). 
  • DSN contains all the information about the
    database

19
Setting up the DSN
  • Setting up the DSN is a simple process.
  • Simply double-click the ODBC in the Control Panel
  • Choose the System DSN tab, and click Add. Choose
    the type of database you'll be working with - the
    sample database is MS Access - then click finish.
  • You'll then need to type in the database name in
    the Data Source Name box, and click Select.

20
Setting up the DSN
  • Next you'll navigate to the drive and directory
    where the database is located,
  • Click on the file name and click OK on that
    window and the one behind it.
  • Now you can refer to the database by name in your
    scripts and the system will know which ODBC
    driver to use and where the database is located.

21
Online ASP Tutorials
  • http//www.vallin.com/pub/1/asp1.asp
  • http//www.4guysfromrolla.com/
  • http//www.15seconds.com/
  • http//www.learnasp.com/
  • http//msdn.microsoft.com/library/default.asp?URL
    /library/en-us/dnasp/html/asptutorial.asp
Write a Comment
User Comments (0)
About PowerShow.com