An ISAPI project to show database information (including images)

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 is a list of all the records in the database. All the items on the list are links to a page that shows information specific to that record. 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

  • it doesn't work!help me!

    Posted by Legacy on 03/27/2003 12:00am

    Originally posted by: egrek.vk

    i changed the dsn name as "
    db.OpenEx("DSN=Images", CDatabase::noOdbcDialog | CDatabase::openReadOnly);
    but it couldn't work ,the browser screen say:it's fail to open the database,other user had opened the db or driver doesn't work properly?

    win2k server+access2000+iis5.0

    Reply
  • It doesn't work

    Posted by Legacy on 06/26/2002 12:00am

    Originally posted by: sujan

    Getting the File Download dialog box !

    Reply
  • how to display information from database with pages?

    Posted by Legacy on 03/26/2002 12:00am

    Originally posted by: jijiuming

    I want to show information with pages,how can i do?
    

    Reply
  • error found in ISAPI

    Posted by Legacy on 08/20/2001 12:00am

    Originally posted by: surajit mukhopadhyay

    The sample code does not work . it gives error
    "System DSN could not be found . No default driver found "

    Please give some suggesion

    Reply
  • It doesn't work

    Posted by Legacy on 04/27/2001 12:00am

    Originally posted by: Devdatta K. Patil

    It is not working properly.

    Reply
  • It doesn't work

    Posted by Legacy on 03/15/2001 12:00am

    Originally posted by: Linh Trang

    It doesn't work. Please help me!

    Reply
  • Solution to make the isapi work

    Posted by Legacy on 07/28/2000 12:00am

    Originally posted by: Michael

    Find the places where its says;
    
    

    db.OpenEx(szConnectString, CDatabase::noOdbcDialog | CDatabase::openReadOnly);

    and write this instead;

    db.OpenEx("DSN=TheDSNname", CDatabase::noOdbcDialog | CDatabase::openReadOnly);

    Reply
  • It doesn't work

    Posted by Legacy on 04/27/2000 12:00am

    Originally posted by: Andrey Zwyagilskii

    It doesn't work on W2K pro.
    I can see
    Browser Failed: Couldn't open data source Data source name not found and no default driver specified
    as a result.

    Reply
  • Multi Thread

    Posted by Legacy on 12/20/1999 12:00am

    Originally posted by: Hassan Khayyat

    Is this code you've written supports multi threading for many ODBC connections?

    Reply
  • thanks for the example, and a suggestion

    Posted by Legacy on 09/13/1999 12:00am

    Originally posted by: Mike Russell

    Thanks for posting the ISAM example sources.

    It would be nice to have a sample html page that runs the example.

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

Top White Papers and Webcasts

  • The impact of a data loss event can be significant. Real-time data is essential to remaining competitive. Many companies can no longer afford to rely on a truck arriving each day to take backup tapes offsite. For most companies, a cloud backup and recovery solution will eliminate, or significantly reduce, IT resources related to the mundane task of backup and allow your resources to be redeployed to more strategic projects. The cloud - can now be comfortable for you – with 100% recovery from anywhere all …

  • Hurricane Sandy was one of the most destructive natural disasters that the United States has ever experienced. Read this success story to learn how Datto protected its partners and their customers with proactive business continuity planning, heroic employee efforts, and the right mix of technology and support. With storm surges over 12 feet, winds that exceeded 90 mph, and a diameter spanning more than 900 miles, Sandy resulted in power outages to approximately 7.5 million people, and caused an estimated $50 …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds