Forums | Email a Colleague | FAQ

Dr. Website Archives

Dr. Website® Archives 2002

October 17, 2002
    Question:
    Dear Dr. Website: I want to send a student status to the Microsoft Acces database base on their performing in the tutorial page. How can I deal with that?

    I'm using Ultradev and ASP as the scripting language.

    Answer:
    This is going to be a lengthy response, so get ready! Here goes:

    This assumes that you're already comfortable using JavaScript and/or VBScript. I'll show you how to do this using Active Server Pages, so your web server will need to be able to process ASP pages (although not required, it helps a lot to be on a Windows server, rather than a Unix server.

    If you're on a Unix server you still have the option of using a product called "ChiliSoft," but it'd probably be easier to use mySQL and PHP instead of MS Access and ASP).

    MS Access can handle 20 concurrent connections, which means that you'd have to get more than 20 visitors on my site at the same time before it would become a problem. At the point where you need a more robust database, you could always upgrade to MS SQL.

    The first major task you have to deal with is the creation of the database itself. Since you would only be adding student names and scores to the database, you only need six fields in the database table:

    * first name
    * last name
    * student ID (perhaps)
    * tutorial ID
    * score
    * pubkey (autonumbering key ID field)

    You'll create the table in MS Access and upload it to your web site directory on your web server.

    Adding Scores to the Database

    So you've got your MS Access database sitting there on your web server, and you've asked your administrator to make it an ODBC database so you can refer to it by its DSN name (we could have pointed to it on the server, but we prefer to be able to refer to it by DSN for simplicity).

    You'll need to be using a form on the "score" HTML page, and you'll need to name the form as well as the individual fields within the form. Essentially the field names should be the same as the database's field names, except that you won't use the pubkey field, as the database itself will automatically add that one.

    The form's action would then call this additional ASP page so the score will be processed and added to the database.

    On the ASP page, the first thing at the top of the page should be:

    <%@ LANGUAGE="VBSCRIPT" %>

    Now we can get into the processing of the data itself.

    <% strfname = cStr(Request.Form("first_name")) strlname = cStr(Request.Form("last_name")) strsID = cStr(Request.Form("student_ID")) strtID = cStr(Request.Form("tutorial_ID")) strscore = cStr(Request.Form("score")) Set oRs = Server.CreateObject("ADODB.Recordset") oRs.Open "studentscores", "DSN=scores;", adOpenKeyset, adLockOptimistic, adCmdTable oRs.AddNew oRS.Fields("first name") = strfname oRS.Fields("last name") = strlname oRS.Fields("student ID") = strsID oRS.Fields("tutorial ID") = strtID oRS.Fields("score") = strscore oRS.Update 'save the changes to the records oRS.Close Set oRS = Nothing %>

    That's essentially it! Now you should be able to add the students scores to a database for later use. Now using the data that's there--that's a whole other lesson.

    For more info on using databases, be sure to check out our new site, DatabaseJournal.com. Thanks, --Dr.Website

    Question:
    Dear Dr. Website:

    I just upgraded my trusty old Netscape 4.7 to Netscape 7. I like all of the changes andam fine with the switch.

    One thing I have noticed that I really like iare the web site icons that appear in the location window and on the "tab" at certain web sites.

    I have a website of my own that I would love to incorporate these "website icons", as Netscape calls them in its Help section, into my own website so that when visitors view my website on a "website icon enabled" browser my own site specific icon will show up.

    My question is: how and where in the html code does the website icon reference code go and how is it configured?

    Thanks!

    Answer:
    You can find all the info at the following URL that you'll need to use your own favicon, as it is called, on your site. http://wdvl.internet.com/Authoring/Design/Images/Favicon/ Thanks,

    --Dr.Website ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ForumsEmail a Colleague · FAQ