Page 260 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 260

Unit 14: Application Development and Administration




               Thus, the final code may look like:                                              Notes
               <html>
               <head>
               <title> Student Data</title>
               </head>
               <body>
               <o1>
               <%
               Dim recordsettest
               Set recordsettest = Server.CreateObject(“ADODB.Recordset’’)

               recordsettest.Open “Student”, Application(“db_conn”)
               Do While Not recordsettest.EOF
                 Response. Write “<li> “& recordsettest (“students-id”) &”
                 Response.Write ‘’<p> “& recordsettest (“name”) &” </p> </li>

                 recordsetest(‘’name)
                 recordsettest.MoveNext
               Loop
               If recordsettest.BOF Then

                 Response.Write “<p>No students data in the database. </p>”
               Recordsettest.Close
               Save this file on the web server. Now, test this program by storing suitable data in the
               database. This application should produce the simple list of the student. However, you can
               create more complex queries to data using SQL. Let us try to explain that with the help of
               an example.



              Task       Data administrator play important role in DBMS. Suggest.


                 Example: Get the list of those students who have a phone number specified by you. More
          than one student may be using use this phone number as a contact number.




             Notes  The actual implementation you would need to create more complex queries.
          Please also note that the only change we need to perform in the programming given above is, in
          the Open statement where we need to insert SQL command, such that on opening the recordset
          only the required data from the database is transferred to it. Thus, the code for this modified
          database access may be:
          <html>
          <head>
          <title> Student Data</title>





                                           LOVELY PROFESSIONAL UNIVERSITY                                   253
   255   256   257   258   259   260   261   262   263   264   265