An ISAPI project to show database information (including images) in frames

This article describes an ISAPI project to show database information. The sample database has three fields: a record id, a name or title, and an image. The field for the image contains the path for the image file instead of the image itself. This approach has the advantage that the access is faster, however the database integrity is harder to maintain and it is more difficult to administer the WWW site. If you decide to include the image in the database, the changes in the ISAM module are minimal (in fact, the code gets smaller and simpler!).

The main page generated by the ISAM consist of two frames: the first contains a list of all the records in the database and the second contains the information of a specific record. All the items on the list are links that change the current record on the second frame. You may want to see the html sources for the dinamically generated pages for a better understanding of how the ISAM works.

The full source code for the ISAM is provided, you will have to compile it in order to get a working site. Before compiling you will have to change some constants in the code: the module location and the ODBC data source name and connection string. These constants are found in isam.h and isam.cpp. Once you have compiled the project with correct site location and ODBC constants you will need to take the following steps to install:

  • Create a directory under your http server root for the project
  • Copy the isam.dll file, the database and the images to this directory
  • Create an ODBC system data source for the database (note that the name for the data source must be the same that you set in the ISAM code)
  • Create a virtual directory in your http server to access the dll (remember to grant execute rights). The name of the directory must be the same you set in the project
  • If necesary, modify the database so the path for the images is valid (you will need Access to do that)

Download Source Code


Last updated: 17 June 1998



Comments

  • Enhanced instructions ISAPI image data base project.

    Posted by Legacy on 12/06/1998 12:00am

    Originally posted by: David

    Enhanced instructions for ISAPI ISAM image data base project.

    (ISAM means Indexed Sequential Access Method (ISAM) databases.)
    Before compiling you will have to change some constants in the code:
    the module location and the ODBC data source name and connection string.
    These constants are found in isam.h and isam.cpp.
    Once you have compiled the project with correct site location and
    ODBC constants you will need to take the following steps to install:

    1. Create a directory under your http server root for the project
    Copy the isam.dll file and the database to this directory

    2. Place the images in any directory you want but see step five.
    The HTML files need only be place in your DevStudio project workspace
    because they become part of the isam.dll after compilation.

    3. Create an ODBC system data source for the database. (DSN means "data source name.")
    Use the ODBC icon in Control Panel, Use the System DSN tab, Click Add,
    Hi-Lite Microsoft Access Driver(*.mdb), Click Finsh, Enter a name "Images",
    Select Images.mdb, Click Ok..
    Note that the name for the data source must be the same that you set in the ISAM.h code.
    (szConnectString DSN=Images.)

    4. Create a virtual directory in your http server to access the dll (remember to grant execute rights).
    The name of the directory must be the same you set in the ISAM.cpp (szLocation = MyVirtualDirectory)

    5. If necesary, modify the database so the path for the images is valid.
    (Open images.mdb in Microsoft Access and change the image paths in the database table field #3.)

    6. For fun you may want to change the HTML code. Here is how:
    Edit the HTML resources in Dev Studio, Recompile all, stop the WWW service,
    copy the isam.dll to it's WWW directory, restart the WWW service.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • 10 Rules that Make or Break Enterprise App Development Projects In today's app-driven world, application development is a top priority. Even so, 68% of enterprise application delivery projects fail. Designing and building applications that pay for themselves and adapt to future needs is incredibly difficult. Executing one successful project is lucky, but making it a repeatable process and strategic advantage? That's where the money is. With help from our most experienced project leads and software engineers, …

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds