Loading ...
Sorry, an error occurred while loading the content.

Learning: connect a web page to a database

Expand Messages
  • Jesse Ackerman
    Hello All: I am just learning how to do this stuff and I am having some difficulity connecting a web page to a database. Could someone please look at my code
    Message 1 of 1 , Mar 1, 2003
    • 0 Attachment
      Hello All:

      I am just learning how to do this stuff and I am
      having some difficulity connecting a web page to a
      database. Could someone please look at my code and
      advise. I am getting confused by the books.

      I created several web pages to register a student for
      classes. I have created a three table "access
      database"

      I have these files all in a folder on my desktop.

      I went throught the process of creating a system DNS
      as directed by the book.

      However I don't think the database.connect() is
      correct in my code.
      Thanks,

      Jesse
      CODE

      <html>
      <head>
      <title>RegisterStudent</title>
      </head>
      <body>
      <script language="JavaScript">
      <server>
      project.lock();
      database.connect("ODBC", db2","", "", "");

      *****<I'm not sure what goes in the above "
      ">*********
      if(!database.connected())
      write("The database is not available.");
      else {
      var SQLString =
      "INSERT INTO Registration VALUES('"
      + client.sid + "', '"
      + request.course + "')";
      database.execute(SQLString);
      database.disconnect();
      }
      </server>
      </script>

      <h2>Backwater University Registration</h2>
      <script language="JavaScript">
      <server>
      write("You are registered for " + request.course);
      write(".To register for another course, click
      <a href='CourseListing.html'> Course Listing</a>
      Or click <a href ='ReviewSchedule.html'>Review
      Schedule</a>
      to review your current schedule.");

      project.unlock();
      </server>
      </script>
      </body>
      </html>



      __________________________________________________
      Do you Yahoo!?
      Yahoo! Tax Center - forms, calculators, tips, more
      http://taxes.yahoo.com/
    Your message has been successfully submitted and would be delivered to recipients shortly.