Page 305 - DCAP408_WEB_PROGRAMMING
P. 305

Unit 14: Database Connectivity




          With an ODBC connection, you can connect to any database, on any computer in your network,  Notes
          as long as an ODBC connection is available.
          An ODBC Connection to an MS Access Database

          Here is how to create a connection to a MS Access Database:
          1.   Open the ODBC icon in your Control Panel.
          2.   Choose the System DSN-less tab.
          3.   Click on Add in the System DSN-less tab.

          4.   Select the Microsoft Access Driver. Click Finish.
          5.   In the next screen, click Select to locate the database.
          6.   Click OK.




             Notes  Note that this configuration has to be done on the computer where your website is
             located. If you are running Personal Web Server (PWS) or Internet Information Server (IIS)
             on your own computer, the instructions above will work, but if your web site is located on
             a remote server, you have to have physical access to that server, or ask your web host to do
             this for you.

          14.1.2 Closing the Connection

          When done with the recordset don’t forget to close it:


            Conn.close
             set
            conn=nothing

          Self Assessment


          Fill in the blanks:
          1.   Click “Add” to add a DSN less entry, and then on “……………………”.
          2.   DSN  less  connections  demand  that  that  you  know  the  name  of  the  file  or  the
               …………………… of the data server.
          3.   The first …………………… request is made to the web server for any *.asp  file in  an
               application causes the Global.asa to be read.
          4.   The easiest way to connect to a database is to use a ……………………
          5.   Armed  with  appropriate  information  you  could  open  a  data  source  without  a
               ……………………
          6.   Enter  the  connection  string  and  use  the  Server.MapPath  method  to  supply  the
               ……………………

          7.   A  DSN Less  Connection   is  defined  by supplying  the precise  full file  path  to  the
               …………………… database.







                                           LOVELY PROFESSIONAL UNIVERSITY                                   299
   300   301   302   303   304   305   306   307   308   309   310