    28      

        Internet 

          Delphi   
,          
Internet. Delphi        
     (Internet app), 
    Internet,      
      Internet. 
     ,     Internet,    
 ,   ,    .  
   Delphi      
Internet  .      
,       Internet,  Delphi  
,     . 
           ,    
      Delphi  Internet.  
       Internet  
 Delphi   Web-.      
 WebBridge     ,  
 ISAPI/NSAPI,     Web-.   
          
   ActiveForm.       
  (thin-client),    ,  
     Internet.     
      ActiveForm  
    Internet.      
      (    )  
 ,   Internet,      Delphi. 
             
     Internet.  ,       
       Internet   
 .    ,     
         Internet 
(  Java). Delphi        
Internet.    Internet  Delphi     
  ,      . Delphi  
    HTML-,       
,   ,      
  Internet. 
         WebBroker,    
    Delphi     
Internet. He     ,     
  "  WebBroker".      ( 
)      WebModule Delphi,   
Delphi   Web     ,  
ActiveForm    Web-.     
   (),    Web  
      .   ,  
      Delphi   WebBridge,  
WebModule     ActiveForm.  ,  
      Internet. 

     28,     Internet 551 

      : Web- 

          Web-.   ,   
     Web-.     
,      Internet,   
     .     
  Delphi    ,    , 
   ,   . 
       Delphi  .    Delphi  
File^New Application,     .  
          
Internet  Web-   Surf.     
Caption    Surf    fmSURFOO.  Position 
  poScreenCenter.    ,  
    Surf .DPR,       
Surf 00. PAS. 
          Surf   . 
    1.      TTabControl       
  tcURL.         
URL,         ,    . 
    2.    alTop     Align   
.   alTop,  TTabControl   
    ,     . 
    3.       TTabControl  ,   
   50 .     , 
      TTabControl. 
    4.         TabWidth   145. 
     ,      
URL,        . 

     . 28.1 ,      . 

           ,   
     . 
    1.      TPanel        
 Align  alBottom.       TTabControl, 
   ,        
  ,    . 
    2.     <F11>,     Object Inspector.   
  Capticr.  TPanel. 
    3.       TabOrder    0.  
     (      
 )       . 
    4.       TPanel      
         
TPanel     TPanel. 
    5.       Align   TPanel  alRight 
     Caption.      
     ,      . 
    6.      BevelOuter  TPanel  bvNone. 
     .     
        ,  
      . 
    7.           TBitBtn. 
    8.      bbGo      Caption 
 Go!. 
    9.        bbHome      Caption 
 . 
    10.    Glyph      
  . 
    11.    Default  bbGo  true.  
    URL    <Enter>   
  .    bbGo     URL, 
       bbHome      
.   ,        . 

    552	 IV.    

    . 28.1.  Web-,   TTabControl 
    . 28.2.  Web-      

     28.     Internet 553 

    12.  ,   TComboBox     
 TPanel     cbURL.     
   Web-,   .   
      Surf    URL  
    cbURL       btGo. 
    13.    Text  cbURL    
    . 
     . 28.2 ,     . 
    ,         Surf   
,      .   
THTML        htBrowser.     
   Web-.  alciient   
  Align  htBrowser,     
   . 28.3 ,      
     . 

       

           Surf,  
      .  ,  
 ,    OnBeginRetrieval  THTML.  , 
    OnClic :     
 OnChange  TTabControl. 
        TTabControl    Object Inspector 
      OnChange.     
 Delphi   . 

    cbURL.Text:=tcURL.Tabs[tcURL.Tablndex]; cbURL.SelectAll;: bbGo.Click; 

      Text  cbURL  ,   
  ,      
cbURL  tcURL.    SelectAll.   Text 
 TComboBox .    Click  
-    .        
 Go!   '    . 

    . 28.3.  ,    


    554  IV.    

        htBrowser    Object Inspector  
     OnBeginRetrieval.    
    . 

    Cursor:=crHourGlass;: 
    if (cbURL.Items.IndexOf(htBrowser.URL)=-1) then begin 
    cbURL.Items.Add(htBrowser.URL); 
    cbURL.Text:=htBrowser.URL; 
    cbURL.SelectAll; 
    tcURL.Tabs.Add(htBrowser.URL) ; 
    tcURL.TabIndex:=tcURL.Tabs.Count-1; 
    bbGo.Click; end; 

     ,    URL     
 cbURL.   URL   ,      
cbURL,    tcURL. 
          Cursor  .  
    ,      
 Web-. 
          , , ,  
-     .     
 OnEndRetrieval  htBrowser.     
  OnEndRetrieval  . 

    Cursor:=crDefault; 

         Web-    . 
          Object Inspector,   
      htBrowser    , 
   . ,    
           . 
    ,     tcURL  htBrowser,  
    .     bbGo,  
        OnClick. 
      . 

    htBrowser.RequestDoc(cbURL.text); 

         htBrowser  Web-, 
   URL,   cbURL. 
          Go!,    
 ,       .     
  OnClick    . 

    htBrowser.RequestDoc(HOMEPAGE); 

         HOMEPAGE,   
 .     Surf 00 . PAS   
   HOMEPAGE. 

    Const 
    HOMEPAGE  =   'http://www.borland.com'; 

      HOMEPAGE     
Implementation  Surf 00. PAS.  ,    
 .   28.128.3 ,    
    . 

     28.1.   Web- Surf 
    program Surf; 
    uses Forms, surfOO in 'surfOO.pas' {fmSurfOO}; 
    {$R *.RES} 

     28.     Internet 555 

    begin 
    Application.Initialize; 
    Application.CreateForm(TfmSurf00, fmSurfOO); 
    Application.Run; end. 

     28.2.       fmSurf 00 
 Surf 

    unit surfOO; interface 
    uses 
    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 
ComCtrls, OleCtrls, isp3, StdCtrls, Buttons, ExtCtrls; 
    type 
    TfmSurfOO = class(TForm) 
    tcURL: TTabControl; 
    Panell: TPanel; 
    Panel2: TPanel; 
    bbGo: TBitBtn; 
    bbHome: TBitBtn; 
    cbURL: TComboBox; 
    htBrowser: THTML; 
    procedure tcURLChange(Sender: TObject); 
    procedure htBrowserBeginRetrieval(Sender: TObject); 
    procedure htBrowserEndRetrieval(Sender: TObject); 
    procedure bbGoClick(Sender: TObject); 
    procedure bbHomeClick(Sender: TObject); private 
    { Private declarations } public 
    { Public declarations } end; 
    var 
    fmSurfOO: TfmSurfOO; 
    implementation {$R *.DFM} 
    Const 
    HOMEPAGE = 'http://www.borland.com'; 
    procedure TfmSurf00.tcURLChange(Sender: TObject); begin 
    cbURL.Text:=tcURL.Tabs[tcURL.Tablndex]; 
    cbURL.SelectAll; 
    bbGo.Click; end; 
    procedure TfmSurf00.htBrowserBeginRetrieval(Sender: TObject); begin 
    Cursor:=crHourGlass; 
    if (cbURL.Items.IndexOf(htBrowser.URL)=-1) then begin 
cbURL.Iterns.Add(htBrowser.URL); cbURL.Text:=htBrowser.URL; cbURL.SelectAll; 
tcURL.Tabs.Add(htBrowser.URL); tcURL.Tablndex:=tcURL.Tabs.Count-1; bbGo.Click; end; 

    556	 IV.    

    end; 
    procedure TfmSurf00.htBrowserEndRetrieval(Sender: TObject); begin 
    Cursor:=crDefault; end; 
    procedure TfmSurf00.bbGoClick(Sender: TObject); begin 
    htBrowser.RequestDoc(cbURL.Text); end; 
    procedure TfmSurf00.bbHomeClick(Sender: TObject); begin 
    htBrowser.RequestDoc(HOMEPAGE); end; 
    end. 

     28.3.     fmSurf 00  Surf 

    object fmSurfOO: TfmSurf00 
    Left = 200 
    Top = 108 
    Width = 544 
    Height = 375 
    Caption = 'Surf Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText 
Font.Height = -11 Font.Name = 'MS Sans Serif Font.Style = [] Position = 
poScreenCenter PixelsPerlnch = 96 TextHeight = 13 object tcURL: TTabControl 
Left = 0 Top = 0 Width = 536 Height = 50 Align = alTop TabOrder = 1 TabWidth 
=145 OnChange = tcURLChange end 
    object Panell: TPanel Left = 0 Top = 307 Width = 536 Height = 41 Align = 
alBottom TabOrder = 0 object Panel2: TPanel Left = 360 Top = 1 Width = 175 
Height = 39 Align = alRight BevelOuter = bvNone TabOrder = 0 object bbGo: 
TBitBtn Left = 8 Top = 8 Width =75 
    
     28.     Internet	557 

    Height = 25 Caption = 'Go ! ' Default = True TabOrder = 0 OnClick = 
bbGoClick Glyph.Data = { 
    76010000424D7601000000000000760000002800000020000000100000000100 
0400000000000001000000000000000000001000000010000000000000000000 
800000800000008080008000000080008000808000007F7F7FOOBFBFBFOOOOOO 
FFOOOOFFOOOOOOFFFFOOFFOOOOOOFFOOFFOOFFFFOOOOFFFFFF00555555555555 
555555FFFFFFFFFF55555000000000055555577777777775FFFFOOB8B8B8B8BO 
0000775F5555555777770BOB8B8B8B8BOFF07F75F555555575F70FBOB8B8B8B8 
BOF07F575FFFFFFFF7F70BFBOOOOOOOOOOF07F557777777777570FBFBFOFFFFF 
FFF07F55557F5FFFFFF70BFBFBOFOOOOOOF07F55557F777777570FBFBFOFFFFF 
FFF075F5557F5FFFFFF750FBFBOFOOOOOOF0575FFF7F777777575700000FFFFF 
FFF05577777F5FF55FF75555550FOOFF00005555557F775577775555550FFFFF 
OFO55555557F55557F755555550FFFFFO0555555557FFFFF7755555555000000 
0555555555777777755555555555555555555555555555555555} NumGlyphs = 2 end 
    object bbHome: TBitBtn Left = 88 Top = 8 Width = 75 Height = 25 Caption = 
'Home' TabOrder = 1 OnClick = bbHomeClick Glyph.Data = {      
    76010000424D7601000000000000760000002800000020000000100000000100 
0400000000000001000000000000000000001000000010000000000000000000 
800000800000008080008000000080008000808000007F7F7FOOBFBFBFOOOOOO 
FFOOOOFFOOOOOOFFFFOOFFOOOOOOFFOOFFOOFFFFOOOOFFFFFF00330000000000 
03333377777777777F333301111111110333337F333333337F33330111111111 
0333337F333333337F333301111111110333337F333333337F33330111111111 
0333337F333333337F333301111111110333337F333333337F33330111111111 
0333337F3333333F7F333301111111B10333337F333333737F33330111111111 
0333337F333333337F333301111111110333337F33FFFFF37F3333011EEEEE11 
0333337F377777F37F3333011EEEEE110333337F37FFF7F37F3333011EEEEE11 
0333337F377777337F333301111111110333337F333333337F33330111111111 
0333337FFFFFFFFF7F3333000000000003333377777777777333} NumGlyphs = 2 end end 
    object cbURL: TComboBox Left = 8 Top = 12 Width = 345 Height = 21 
ItemHeight = 13 TabOrder = 1 end end 
    object htBrowser: THTML Left = 0 Top = 50 Width = 536 Height = 257 
ParentColor = False ParentFont = False Align = alClient TabOrder = 2 
    OnBeginRetrieval = htBrowserBeginRetrieval OnEndRetrieval = 
htBrowserEndRetrieval ControlData = { 

    558	 IV.    

    170996190800000066370000901000000000001010100011 
0100000000COCOCOOOOOOOOOOOOOOOFFOOFFOOFF00010000009001COD401000F 
54696D6573204E657720526F6D616E010000009001A08601000B436F75726965 
72204E657701000000BC0280A903000F54696D6573204E657720526F6D616E01 
OOOOOOBC0220BF02000F54696D6573204E657720526F6D616E01000000BC02EO 
2202000F54696D6573204E657720526F6D616E01000000BC02COD401000F5469 
6D6573204E657720526F6D616E01000000BC02A08601000F54696D6573204E65 
7720526F6D616E01000000BC02803801000F54696D6573204E657720526F6D61 6} end end 
        Surf.   ,   
 <F9>   .  . 28.4   Surf  
 . 

    htp://vadAliL;.kievA:80|htlp:W'ad.di8l.lu.k>=v.ua-80/<h!tp://vaddiiil.iu.kvua80/<| 

    Getting Started with Microsoft Personal Web Server 
    Personal Web Server transmit! information in Hypertext Markup Language 
(HTML) pages by using the Hypertext Transport Protocol (HTTP). It provides 
most of the functionality of Microsoft Internet Information Server, including 
the ability to: 
    	Publish Web pages on the Internet or over a LAN on an intranet. 
    	Support Microsoft ActiveX programs. 
    	Transmit or receive files by using the FTP service. 
    Creating a Web site on your own computer 
    After you install Personal Web Server, you need to complete several steps. 
    1. By default, your home directory is C:\Webshare\Wwwroot Copy any HTML 
files you want on your site to this folder 
    2. Test your Personal Web Server installation. 
    After you have logged in, if Personal Web Server does not start, you can 
start it as follows. To start Personal Web Server 
    1. In Control Panel, double-click the Personal Web Server icon 
    2. On the Startup tab, click Start. 
    Tip 
     To have Personal Web Server start automatically when you restart your 
computer, select the check box labeled Run The Web Server Automatically At Startup. 
    After you have started your server, it is a good idea to test it by using 
Internet Explorer to view the files in your home 

    Hifrt^fw 
     i 

    . 28.4.  Surf    

        Microsoft Internet Explorer (IE)  3.0  
 ,      THTML   Surf 
   ,     IE 3.x.    
 . 
    1.     Delphi  Components Import ActiveX Control. 
    2.        Microsoft 
Internet Controls. 
    3.    Install.	
    4.        Install,    
 dclusrSO   TWebBrowser. 
    5.    ,     dclusrSO,   
 Yes. 
    6.    ,     Information, 
    
.	

     28.     Internet 559 

    7.       Package,    
  Yes,       . 
    8.    TWebBrowser     
Delphi.   |  ActiveX,    . 
  ,  Microsoft \E 3.x      OLE.  
,       -  
   ,    IE 3.x. 
     . 28.5    Surf,     
 ActiveX Web-  Microsoft. 

    htp,7/vaddta!.RikteY.ua:8 
    Ihtlp //vaddialru.kiev.ua:80A HtpjVvad datru.kiev ua:80/d 
    FTP Server Administration 
    In addition to the World Wide Web service, Microsoft Personal Web Server 
includes File Transfer Protocol (FTP). To create  FTP site on your computer 
    1. In Control Panel, double-click the Personal Web Server icon. 
    2. Click the Services tab. 
    3 On the Services property sheet, select FTP, and then click Start. 
    By default, your home directory is C:\WebShare\Ftproot You can, however, 
set a different directory to be the FTP home directory. 
    To set a different directory to be the home directory 
    1. In Control Panel, double-click the Personal Web Server icon. 
    2. On the Administration tab, click Administration. 
    3 On the Internet Services Administrator page, click FTP Administration 
    4 On the Directories tab, click Add 
    5. Type the path of a directory on your computer, or click Browse to 
search for the directory 
    6. Click Home Directory 
    7. To give people write access to the directory, in the Access box, select 
the Write check box -or-To give people read-only access to the directory, 
select the Read check box. 
    After you have set up your home directory, you can configure it. 

    . 28.5.        
 ActiveX  IE 3.x 


      :   Web- 

           ,   
  Web-.       
 ,   .      
    ,    17, "InterBase". 
       WebBridge Delphi,    
   : NSAPI  ISAPI. WebBridge  
  Web-,     API.   
      .   
    API Web-  Microsoft  
Netscape          . 
     WebBridge Delphi      
   Web-    File^New^Web 
Server Application.         
  WebBridge    " "    
  . 
     Delphi,     Web-,   
 : ISAPI/NSAPI-  DLL, CGI- 
   WinCGI-  .   
   . 

    560  IV.    

       

        ,     
 Web-,     InterBase SALES.GDB, 
     17.   28.4   
SQL,       WISQL InterBase,   
  SALES,             
   17. 

      
       SQL ,     : 
\DATA\IB.     ,    
,       SALES.      
 ,     . 

     28.4.  SQL SALES . SQL     SALES . GDB 

    /*    c:\data\ib\SALES.gdb. */ 
    CREATE DATABASE "c:\data\ib\SALES.gdb" USER "SYSDBA" PASSWORD "masterkey"; 
    /* : CUSTOMER, : SYSDBA. */ 
    CREATE TABLE CUSTOMER (CUSTOMERNUMBER INTEGER NOT NULL, 
    LASTNAME CHAR(30), 
    FIRSTNAME CHAR(30), 
    STREETADDRESS CHAR(30), 
    CITY CHAR(20), 
    STATE CHAR(2), 
    ZIP CHAR(10), PRIMARY KEY (CUSTOMERNUMBER)); 
    /* : CUSTOMERARRAY, : SYSDBA. */ 
    CREATE TABLE CUSTOMERARRAY (CUSTOMERNUMBER INTEGER NOT NULL, 
    LASTNAME CHAR(30), 
    FIRSTNAME CHAR(30), 
    STREETADDRESS CHAR(30) [1: 3] , 
    CITY CHAR(20), 
    STATE CHAR(2), 
    ZIP CHAR(10)); 
    /* : GOVITEM, : SYSDBA. */ CREATE TABLE GOVITEM 
(ITEMNUMBER INTEGER NOT NULL, 
    DESCRIPTION CHAR(30), 
    PRICE FLOAT, 
    GOVERNMENTPRICE COMPUTED BY (Price - Price * .15)); 
    /* : ITEM, : SYSDBA. */ CREATE TABLE ITEM (ITEMNUMBER 
INTEGER NOT NULL, 
    DESCRIPTION CHAR(30), 
    PRICE FLOAT); 
    /* : REPORTLOG, : SYSDBA. */ 
    CREATE TABLE REPORTLOG (REPORTUSER VARCHAR(20) DEFAULT USER 
     
    REPORTDATE DATE DEFAULT "TODAY" 
    REPORTDATETIME DATE DEFAULT "NOW" ); 
    /* : SALE, : SYSDBA. */ CREATE TABLE SALE (SALENUMBER 
INTEGER NOT NULL, 
    SALEDATE DATE, 
    CUSTOMERNUMBER INTEGER NOT NULL, 
    ITEMNUMBER INTEGER NOT NULL, 
    AMOUNT FLOAT); 

     28.     Internet	561 

    /* : SALE_HISTORY, : SYSDBA */ 
    CREATE TABLE SALE_HISTORY EXTERNAL FILE "C:\DATA\IB\SALEHIST.DAT" 
(SALENUMBER INTEGER 
    NOT NULL, 
    SALEDATE DATE, 
    CUSTOMERNUMBER INTEGER NOT NULL, 
    ITEMNUMBER INTEGER NOT NULL, 
    AMOUNT FLOAT); ALTER TABLE SALE ADD FOREIGN KEY (CUSTOMERNUMBER) 
REFERENCES CUSTOMER(CUSTOMERNUMBER); 
    /*    . */ 
    INSERT INTO CUSTOMER (CustomerNumber, LastName, FirstName, StreetAddress, 
City, State, 
    Zip) 
    VALUES(1,'Doe','John','123 Sunnylane','Anywhere', 'MO','73115'); 
    INSERT INTO CUSTOMER (CustomerNumber, LastName, FirstName, StreetAddress, 
City, State, 
    Zip) 
    VALUES(2,'Doe','Jane','123 Sunnylane','Anywhere', 'MO','73115'); 
    INSERT INTO CUSTOMER (CustomerNumber, LastName, FirstName, StreetAddress, 
City, State, 
    Zip) 
    VALUES(3,'Philgates','Buck','57 Riverside','Reo1,'AR','65803'); 
    INSERT INTO ITEM (ItemNumber, Description, Price) VALUES(1001, 'Zoso LP',13.45); 
    INSERT INTO ITEM (ItemNumber, Description, Price) VALUES(1002, 'White LP',67.90);: 
    INSERT INTO ITEM (ItemNumber, Description, Price) VALUES(1003, 'Bad Co. LP',11.45); 
    INSERT INTO SALE (SaleNumber, SaleDate, CustomerNumber, ItemNumber, 
Amount) VALUES(101, ' 07/07/95',1,1001,13.45); 
    INSERT INTO SALE (SaleNumber, SaleDate, CustomerNumber, ItemNumber, 
Amount) VALUES(102,'07/08/95',2,1002,67.90); 
    INSERT INTO SALE (SaleNumber, SaleDate, CustomerNumber, ItemNumber, 
Amount) VALUES(103, '07/09/95 ',3,1003,11.45) ; 
    INSERT INTO SALE (SaleNumber, SaleDate, CustomerNumber, ItemNumber, 
Amount) VALUES(104,'07/10/95',1,1002,67.90); 
    /*   . */ 
    CREATE EXCEPTION SALE_TOO_LOW "The sale is too low. Only sales of $5 or 
more are allowed. "; COMMIT WORK; SET AUTODDL OFF; SET TERM  ; 
    /*  . */ 
    CREATE PROCEDURE GET_CUSTOMER_BY_STATE AS BEGIN EXIT; END  
    CREATE PROCEDURE INSERTITEM AS BEGIN EXIT; END  
    CREATE PROCEDURE INSERTSALE AS BEGIN EXIT; END  
    ALTER PROCEDURE GET_CUSTOMER_BY_STATE (STATE CHAR(2)) 
    RETURNS (LASTNAME CHAR(30)) 
    AS 
    BEGIN 
    FOR SELECT LastName FROM CUSTOMER WHERE State = :State INTO :LastName 

    562  IV.    

    DO 
    SUSPEND; 
    END 
    ALTER PROCEDURE INSERTITEM (ITEMNUMBER INTEGER, DESCRIPTION CHAR(30), 
PRICE FLOAT) AS 
    BEGIN 
    INSERT INTO ITEM (ItemNumber, Description, Price) VALUES (:ItemNumber, 
:Description, :Price); 
    END 
    ALTER PROCEDURE INSERTSALE (SALENUMBER INTEGER, 
    SALEDATE DATE, 
    CUSTOMERNUMBER INTEGER, 
    ITEMNUMBER INTEGER, 
    AMOUNT FLOAT) 
    AS 
    BEGIN 
    IF (:Amount < 5) THEN 
    EXCEPTION SALE_TOO_LOW; ELSE 
    INSERT INTO SALE 
    VALUES (:SaleNumber, :SaleDate, :CustomerNumber, :ItemNumber, :Amount); END 
    SET TERM ;  COMMIT WORK ; SET AUTODDL ON; 
    /*    . */ 
    DECLARE EXTERNAL FUNCTION MAXINT 
    INTEGER, INTEGER 
    RETURNS INTEGER BY VALUE 
    ENTRY_POINT "Maxlnt" MODULE_NAME "IBUDFLIB.DLL"; 
    DECLARE EXTERNAL FUNCTION MININT 
    INTEGER, INTEGER 
    RETURNS INTEGER BY VALUE 
    ENTRY POINT "Minlnt" MODULE NAME "IBUDFLIB.DLL"; 

      
          -. 
           File^Run an ISQL Script  
WISQL.          Web-. 

      

         Web-   . 
    1.      File^New,       
Web Server Application    New Items. 
    2.       New Web Server Application    OK, 
       Web-: 
ISAPI/NSAPI Dynamic Link Library. 

     28.     Internet 563 

    3.          WebModule  wmSales. 
 TWebModule  TDataModul,     
  Web- (, TDataSetTableProducer, 
TPageProducer, TTable  ..).      ,  
    ,     
TWebModule  TDataModule,     TWebDispatcher.   
    ,   TWebModule,     
 HTTP           
. ,   ,     
Web-,       Web.	I 
     TWebModule   ,    
HTTP.     ,       HTTP, 
        Delphi, 
    .     Web, 
  . 
    4.      BDE (     )    
    InterBase SALES.     IB_SALES. 
    5.        TDatabase     
AliasName  IB_SALES.  TDatabase    , 
        SALES   
.  ,       
 DLL,    Web-.  BDE   
 -  ,       , 
  DLL Web-    
        .  
  ,       SALES 
 . 
    6.         Name  DatabaseName  
TDatabase  dbSALES.    DatabaseName,   
  BDE,       . 
    7.      LoginPrompt  TDatabase  False,  
        : 

    USER NAME=SYSDBA PASSWORD=masterkey 

               
SALES.   LoginPrompt   False,   
TDatabase   ,   Params. 
    8.   TSession    Web     
 AutoSessionName  True.     
Web-    .    SessionName 
    Web      
 TSession. 
    9.     TTable     taltem.  
   DatabaseName  dbSALES,    TableName  
 ITEM.          
 ,       . 
    10.        <Ctrl+A>,   
    .     . 
    11.     TDataSource      
Name  dsltem.    DataSet,    taltem. 
    12.     TQuery     quSales. 
   DatabaseName,     dbSales 
 TDatabase,  . 
    13.     SQL  quSales    . 

    select  *   FROM SALE 
    WHERE  ItemNumber=:ItemNumber 

    14.    DataSource  quSales  dsltem. 
   ItemNumber       ITEM. 

    564	 IV.    564	 IV.    

    15.     Params      
 itemNumber   Integer. 
    16.      TQuery   <CtrH-A>,  
     Web.    ,  
 . 
    17.   TQueryTableProducer (   Internet 
 )     Web     qpSales. 
    Caption  Item Sales. 
    18.    Query  qpSales  quSales.  
      QueryTableProducer  
  Query.  ,  qpSales    HTML, 
   ,   quSales. 
    19.     Columns     
 .    Add All Fields,    
    ,     . 
    20.   Border, CellPadding  CellSpacing  
TableAttributes  QueryTableProducer  -1  1.    , 
          
  .     ,    
.       -1    
 . 
    21.      Web    
   private  . 

    ScriptName: String; 

     ScriptName       
     . 
    22.     TPageProducer      
ppitemList.         
  . 
    23.     OnHTMLTag     
     : 

    procedure  TwmSales.ppItemListHTMLTag(Sender:   TObject;   Tag:   TTag 
    const   TagString:   String;   TagParams:   TStrings;   var  ReplaceText:  
 String); 
    Items   :   String; begin 
    if  CompareText(TagString,    'ITEMLIST')   =  0  then begin Items   :=   
' ' ; taltem.First; while  not   taltem.Eof   do  begin 
    Items   :=Items   +   ' <A HREF="'   +   ScriptName  +   
'/runquery?ItemNumber='+ taltemltemNumber.AsString  +   '">>   +  
taltemDescription.AsString  + '</AXBR>' ; taltem.Next; end; end; 
    ReplaceText   :=   Items; end; 

          ITEMLIST  
     ITEM.     
    HTML,       RaplaceText.	"*"" 
    24.       ITEMLIST?   
       HTMLDoc    . 

    <HEAD> 
    <TITLE>Product Listing Web Server App</TITLE> 
    </HEAD> 
    <BODY> 
    <H2>Item Sales Informationx/H2> 

     28.     Internet 565 

    <HR> 
    Click an item to view its sales.<P> 
    <#ITEMLISTXP> 
    </BODY> 
    </HTML> 

     ,         #ITEMLIST. 
  -j   HTML,    
 OnHTMLTag.  ]     
   HTML. 
    25.       Web    . 
    26.          Add,            .   
          
    ppltemList      Default  True. 
    27.     OnAction    . 

    Response.Content:=pp!temList.Content; 

          , 
  .     Content  
ppltemList      OnHTMLTag  
ppltemList    . 
    28.         Add    
   I   QueryAction.     
Pathlnfo  /runquery.       HTML  
 OnHTMLTag,  ,       
 /runquery. 
    29.     OnAction     
 . 

    if taltem.Locate('ItemNumber',   Request.QueryFields.Values['ItemNumber'], 
   []; then  begin 
    qpSales.Header.Clear; 
    qpSales.Header.Add('Sales   of:    '   +   taltemDescription.AsString); 
    Response.Content   :=  qpSales.Content; end else 
    Response. Content   :=   Format ('<HTMLXBODYXB>Item:    %s   not   
found</BX/BODYX, [Request.QueryFields.Values['ItemNumber']]); 

          Web     
  t a ITEM,        . 
    (    ),    
TQueryTableProducer  ,   ,   
  Content  qpSales   
 Content  Response.    Content 
 qpSales   quSales,      
  HTML. 
    30.   ,       
OnCreate   Web   Object Inspector.    
   . 

    procedure  TwmSales.wmSalesCreate(Sender:   TObject); var 
    FN:   array[0..MAX_PATH   -   1]   of  char; begin 
    taltem.Open; 
    SetString(ScriptName, FN, GetModuleFileName(hlnstance, 
    ScriptName := ExtractFileName(ScriptName); end; 
    FN,   SizeOf(FN) 

              
      ,   . 
    31. ,     .    
,      .     Web 
WEBSRVOO. PAS,     WEBSRV. DPR. 
    32.   ,  Web-     
 NSAPI/ISAPI DLL.   DLL,   .  
  ,  ,    WEBSRV. DLL. 

    566  IV.    

      Web- 

        ,    
    Web- (,  
inetpub\scripts  Internet Information Server  Microsoft.)  
   ,  URL http: //< ->/ 
<nonKaTaAor>/websrv.dii  Web-.  < ->   
 Web-    IP    ,   
  DLL. ,      Microsoft US, 
     ,    ,    
http://127.0.0.1/scripts/websrv.dll (  
http://localhost/scripts/websrv.dll),  12^7. O.O.I   
  TCP/IP.  . 28.6 ,      Web-. 

      
      Web-      FastTrack 
Netscape,     . 
    1.   ISAPITER. DLL   Bin Delphi   \Net.scape\Server\Nsapi\Examples. 
    2.   Web-.       
Netscape Administration,      FastTrack. 
    3.   \Netscape\Server\Httpd-<MMH Web-cepBepa>\Config\OBJ.CONF 
  Init fn=load-types n-iime-types^mime. types    
  : 
    Init funcs="handle-isapi, check-isapi, log-isa.pi" fn:="load~lodules" 
shiib="c:/netscape/server/nsapi/examples/I SAP Iter.dll "   
    . 
    4.    <object name==default>  OBJ.CONF   
NameTrans fn^document-root root="C:Netscape/Server/docs    : 
    NameTrans from="/scripts" fns"pfx2dir" 
dir="C:/Netscape/Server/docs/scripts" naine="isapi" 
    5.    OBJ. CONF   : 

    <0bject name="isapi"> 
    PathCheck fn=="check-isapi" 
    ObjectType fn=="force-type" type="magnus-internal/isapi" 
    Service fn="handle-isapi" 

    6.    \Netscape\Server\Httpd-<MMH Web-cepBepa^XMIMET'TYPES ': 

    type=magnus-internal/isapi exts=dll 

    7.  Web-.     
  ,     ,    
Apply   Administration,     . 
          ,    
    .     SQL, 
     SALE    
 .  . 28.7 ,    , 
    . 
        Web- .    , 
  Web. 
      28.528.7      WEBSRV. DLL. 

     28.     Internet 567 

    
    . 28.6.        Web-   
 Netscape Navigator 
    
    . 28.7.  Web-      
    
    568  IV.    

     28.5.     WEBSRV. DPR 

    library websrv; 
    uses 
    HTTPApp, 
    ISAPIApp, 
    websrvOO in 'websrvOO.pas' {wmSales: TWebModule}; 
    f$R *.RES} 
    exports 
    GetExtensionVersion, 
    HttpExtensionProc, 
    TerminateExtension; 
    begin 
    Application.Initialize; 
    Application.CreateForm(TwmSales, wmSales); 
    Application.Run; end. 
     28.6.     WEBSRVOO . PAS  WEBSRV 
    unit websrvOO; interface 
    uses 
    Windows, Messages, SysUtils, Classes, HTTPApp, DBWeb, DBTables, Db; 
    type 
    TwmSales = class(TWebModule) 
    dbSALES: TDatabase; 
    Sessionl: TSession; 
    taltem: TTable; 
    taltemlTEMNUMBER: TIntegerField; 
    taltemDESCRIPTION:" TStringField; 
    taltemPRICE: TFloatField; 
    quSales: TQuery; 
    quSalesSALENUMBER: TIntegerField; 
    quSalesSALEDATE: TDateTimeField; 
    quSalesCUSTOMERNUMBER: TIntegerField; 
    quSalesITEMNUMBER: TIntegerField; 
    quSalesAMOUNT: TFloatField; 
    qpSales: TQueryTableProducer; 
    dsltem: TDataSource; 
    ppItemList: TPageProducer; 
    procedure ppItemListHTMLTag(Sender: TObject; Tag: TTag; const TagString: 
String; TagParams: TStrings; var ReplaceText: String); 
    procedure wmSalesppItemListAction(Sender: TObject; 
    Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); 
    procedure wmSalesQueryActionAction(Sender: TObject; 
    Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); 
    procedure wmSalesCreate(Sender: TObject); private 
    { Private declarations } 
    ScriptName: String; public 
    { Public declarations } end; 
    var 

     28.     Internet 569 

    wmSales: TwmSales; implementation {$R *.DFM} 
    procedure TwmSales.ppItemListHTMLTag(Sender: TObject; Tag: TTag; 
    const TagString: String; TagParams: TStrings; var ReplaceText: String); var 
    Items : String; begin 
    if CompareText(TagString, 'ITEMLIST') = 0 then begin Items := ''; 
taltem.First; while not taltem.Eof do begin 
    Items := Items + '<A HREF="' + ScriptName + '/runquery?ItemNumber=' + 
taltemltemNumber.AsString + '">' + taltemDescription.AsString + 
    '</AXBR>' ; taltem.Next; end; end; 
    ReplaceText := Items; end; 
    procedure TwmSales.wmSalesppItemListAction(Sender: TObject; 
    Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); begin 
    Response.Content:=pp!temList.Content; end; 
    procedure TwmSales.wmSalesQueryActionAction(Sender: TObject; 
    Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); begin 
    if taltem.Locate('ItemNumber', Request.QueryFields.Values['ItemNumber'], 
[]) then begin 
    qpSales.Header.Clear; 
    qpSales.Header.Add('Sales of: ' + taltemDescription.AsString); 
Response.Content := qpSales.Content; end else 
    Response. Content := Format (' <HTMLXBODYXB>Item: %s not found</BX/BODYX/HTML>', 
    [Request.QueryFields.Values['ItemNumber']]); end; 
    procedure TwmSales.wmSalesCreate(Sender: TObject); var 
    FN: array[0..MAX_PATH - 1] of char; begin 
    taltem.Open; 
    SetString(ScriptName, FN, GetModuleFileName(hlnstance, FN, SizeOf(FN))); 
    ScriptName := ExtractFileName(ScriptName); end; 
    end. 
     28.7.      Web WEBSRVOO . 
DFM  WEBSRV 
    object wmSales: TwmSales OnCreate = wmSalesCreate Actions = < item 
    Default = True Name = 'ppItemList' OnAction = wmSalesppItemListAction end 

    570	 IV.    

item

Name = 'QueryAction' Pathlnfo = '/runquery' OnAction = wmSalesQueryActionAction end>

Left = 200 Top = 108 Height = 150 Width = 215

object dbSALES: TDatabase AliasName = 4B_SALES' DatabaseName = 'dbSales' LoginPrompt = False Params.Strings = ( 'USER NAME=SYSDBA' 1PASSWORD=masterkey') SessionName = 'Sessionl_6' Left = 128 Top = 72 end

object Session!: TSession AutoSessionName = True Left = 168 Top =40 end object taltem: TTable

DatabaseName = 'dbSales' SessionName = 'Sessionl_6' TableName = ' Left = 8 Top = 8

object taltemlTEMNUMBER: TIntegerField FieldName = 'ITEMNUMBER' Required = True end

object taltemDESCRIPTION: TStringField FieldName = 'DESCRIPTION' Size = 30 end object taltemPRICE: TFloatField

FieldName = 'PRICE' end end

object quSales: TQuery DatabaseName = 'dbSales' SessionName = 'Sessionl_6' DataSource = dsltem SQL.Strings = (

'select * FROM SALE' 'WHERE ItemNumber=:ItemNumber')

Params.Data = {010001000A4954454D4E554D42455200030400000000000100} Left = 8 Top = 72

object quSalesSALENUMBER: TIntegerField FieldName = 'SALENUMBER' Origin = 'SALE.SALENUMBER' end

object quSalesSALEDATE: TDateTimeField FieldName = 'SALEDATE' Origin = 'SALE.SALEDATE' end

object quSalesCUSTOMERNUMBER: TIntegerField FieldName = 'CUSTOMERNUMBER' Origin = 'SALE.CUSTOMERNUMBER' end

 28.     Internet	571

object quSalesITEMNUMBER: TIntegerField FieldName = 'ITEMNUMBER' Origin = 'SALE.ITEMNUMBER' end

object quSalesAMOUNT: TFloatField FieldName = 'AMOUNT' Origin = 'SALE.AMOUNT' end end

object qpSales: TQueryTableProducer Caption = 'Item Sales' Columns = < item

FieldName = 'SALENUMBER' end item

FieldName = 'SALEDATE' end item

FieldName = 'CUSTOMERNUMBER' end item

FieldName = 'ITEMNUMBER1 end item

FieldName = 'AMOUNT' end>

Query = quSales TableAttributes.Border = 1 TableAttributes.CellSpacing = 1 TableAttributes.CellPadding = I Left = 64 Top = 72 end

object dsltem: TDataSource DataSet = taltem Left = 64 Top = 8 end

object ppItemList: TPageProducer HTMLDoc.Strings = ( 1<HEAD>'

'<TITLE>Product Listing Web Server App</TITLE>' '</HEAD>' '<BODY>'

'<H2>Item Sales Information</H2>' '<HR>'

'Click an item to view its sales.<P>' '<#ITEMLIST><P>' '</BODY>' '</HTML>')

OnHTMLTag = ppItemListHTMLTag Left = 128 Top = 8 end end

  Web-

 Delphi       ,    ,          Web-.   ,  Web-         ,    Web-.   WEBSRV.DLL   Web-,   .

572	 IV.   

    item 
    Name = 'QueryAction' Pathlnfo = '/runquery' OnAction = 
wmSalesQueryActionAction end> 
    Left = 200 Top = 108 Height = 150 Width = 215 
    object dbSALES: TDatabase AliasName = 4B_SALES' DatabaseName = 'dbSales' 
LoginPrompt = False Params.Strings = ( 'USER NAME=SYSDBA' 
1PASSWORD=masterkey') SessionName = 'Sessionl_6' Left = 128 Top = 72 end 
    object Session!: TSession AutoSessionName = True Left = 168 Top =40 end 
object taltem: TTable 
    DatabaseName = 'dbSales' SessionName = 'Sessionl_6' TableName = ' Left 
= 8 Top = 8 
    object taltemlTEMNUMBER: TIntegerField FieldName = 'ITEMNUMBER' Required = 
True end 
    object taltemDESCRIPTION: TStringField FieldName = 'DESCRIPTION' Size = 30 
end object taltemPRICE: TFloatField 
    FieldName = 'PRICE' end end 
    object quSales: TQuery DatabaseName = 'dbSales' SessionName = 'Sessionl_6' 
DataSource = dsltem SQL.Strings = ( 
    'select * FROM SALE' 'WHERE ItemNumber=:ItemNumber') 
    Params.Data = {010001000A4954454D4E554D42455200030400000000000100} Left = 
8 Top = 72 
    object quSalesSALENUMBER: TIntegerField FieldName = 'SALENUMBER' Origin = 
'SALE.SALENUMBER' end 
    object quSalesSALEDATE: TDateTimeField FieldName = 'SALEDATE' Origin = 
'SALE.SALEDATE' end 
    object quSalesCUSTOMERNUMBER: TIntegerField FieldName = 'CUSTOMERNUMBER' 
Origin = 'SALE.CUSTOMERNUMBER' end 

     28.     Internet	571 

    object quSalesITEMNUMBER: TIntegerField FieldName = 'ITEMNUMBER' Origin = 
'SALE.ITEMNUMBER' end 
    object quSalesAMOUNT: TFloatField FieldName = 'AMOUNT' Origin = 
'SALE.AMOUNT' end end 
    object qpSales: TQueryTableProducer Caption = 'Item Sales' Columns = < item 
    FieldName = 'SALENUMBER' end item 
    FieldName = 'SALEDATE' end item 
    FieldName = 'CUSTOMERNUMBER' end item 
    FieldName = 'ITEMNUMBER1 end item 
    FieldName = 'AMOUNT' end> 
    Query = quSales TableAttributes.Border = 1 TableAttributes.CellSpacing = 1 
TableAttributes.CellPadding = I Left = 64 Top = 72 end 
    object dsltem: TDataSource DataSet = taltem Left = 64 Top = 8 end 
    object ppItemList: TPageProducer HTMLDoc.Strings = ( 1<HEAD>' 
    '<TITLE>Product Listing Web Server App</TITLE>' '</HEAD>' '<BODY>' 
    '<H2>Item Sales Information</H2>' '<HR>' 
    'Click an item to view its sales.<P>' '<#ITEMLIST><P>' '</BODY>' '</HTML>') 
    OnHTMLTag = ppItemListHTMLTag Left = 128 Top = 8 end end 
      Web- 
     Delphi      
 ,    ,        
  Web-.   ,  Web-   
      ,   
 Web-.   WEBSRV.DLL   Web-, 
  . 

    572	 IV.    

    1.     Web-,      .  
     . 
    2.          Microsoft Internet 
Information Server,      , 
    RunoRarameters. 
    Host  application:   c:\winnt\system32\inetsrv\inetinfo.exe Run 
parameters:   -e  w3svc 
    3.      Netscape FastTrack Server,  
  ,     Run^Parameters,  . 
    Host  application:   c:\Netscape\server\bin\httpd.exe 
    Run  parameters:   Netscape\server\httpd-<^Mj?  ffeJb-cepBepa>\conf.ig 
     < Web-cepeepa>    Web-. 
    4.       Windows 95 Personal Web Server, 
  . 
    Host  application:   c:\Program Files\websvr\system\inetsw95.exe Run  
parameters:   -wSsvc 
    ,         , 
   . 
    5.   Delphi    ,     
     . 
    6.    Run,   .    
   Web-    Delphi. 
    7.  Web-    DLL  , 
   .     ,  
     Delphi  ,  
  . 
      Windows NT      
  ,      DLL  .  
   DLL  Windows NT,   . 
    1.    User Manager Windows NT   Policies'^User Rights. 
    2.   Show Advanced User Rights. 
    3.     Act As Part Of The Operating System. 
    4.    Add,     (   ) 
  Grant To. 
    5.    .     DLL  
Windows NT. 

      :  ActiveForm 

            OCX, 
   SQL,      
  Web-.  WeblSQL,   WISQL InterBase, 
   SQL   .     
    ,        
Web-,      . 
           ActiveX,   
ActiveForm. Delphi       OCX   
   HTML-.       
  HTML-     Web-. 
    HTML-  Web-     
  ActiveForm. 

      

       fmWeblSQL  WeblSQL,   . 
    1.      File^New Application    
.     File^New,      
ActiveX      ActiveForm. 

     28.     Internet 573 

    2.      ActiveForm Wizard     
 fmWebiSQL,      WeblSQLO,   
  WeblSQL.     . 
    3.       ,         
 ,      ActiveX.   
 ,      ActiveX. 
    4.         WeblSQL      
AutoScroll  True. 
    5.      Height    325,   
 Width   53..        
  ,  Delphi     
 HTML-.   ( )    
,         Web-. 
       Delphi HTML-,    
      . 
    6.           Panel    
  Caption. 
    7.       Align    alTop,  
  alBottom     alClient.     
   ,        
 40%    . 
    8.          TSession     
 AutoSessionName  True.     TSession, 
        . 
    9.      TDatabase    TSession   
   Name  dbWeblSQL.   DatabaseName  
  dbWeblSQL.       
   WeblSQL. 
    10.   TQuery    TDatabase   
  quWebiSQL. 
    11.       TQuery    
 taWeblSQL. 
    12.    DatabaseName    TQuery 
 dbWeblSQL. 
    13.   TDataSource       
  dsWeblSQ-   DataSet  quWebiSQL. 
    14.   TComboBox        
  cbAliases.        BDE 
   . 
    15.       TComboBox.    
cbTables.        ( 
WeblSQL    ,       SQL). 
    16.   Text   . 
    17.   TLabel      
      . 
    18.   DBNavigator   cbTables     
  .   dnaWeblSQL. 
    19.   DBNavigator   TSpeedButton    
 sbGo.        
 ,     Glyph   , 
   .       
VCRPLAY   Images \Buttons   Delphi. 
    20.   TLabel   sbGo     
 . 
    21.      TMemo,    meQuery 
     Lines.     Align 
 alClient,      . 
    22.      TDBGrid     
dgdResults.     Align  alClient.   
   . 
    23.    DataSource  DBNavigator  DBGrid 
 dsWeblSQL.  . 28.8 ,     fmWebiSQL. 

    574	 IV.    

    .. 2 1. ߫   fmWeblSQL  WeblSQL 

      

    ,     ,     
   ,   .   
    WeblSQL,   . 
    1.       Object Inspector  ,    
   OnCreate    . 

    Sessionl.GetAliasNames(cbAliases.Items); if  cbAliases.Items.Count>0  then begin 
    cbAliases.Itemlndex:=0; 
    cbAliasesClick(Sender); end else  cbAliases.Itemlndex:=-!; 

           
cbAliases   .    ,   
       . 
    2.     cbAliases      
   OnClick   Object Inspector.    
    . 

    if  cbAliases. Texto1 '   then with dbWeblSQL do begin 
    If Connected then Close; 
    AliasName:=cbAliases.Items[cbAliases.Itemlndex]; 
    cbTables.Items.Clear; 
    cbTables.Text:=''; 
    Open; 
    Sessionl.GetTableNames(AliasName,'',not(IsSQLBased), 
    IsSQLBased,cbTables.Items); end; 

            
  cbAliases     dbWeblSQL.   
         cbTables. 

     28.     Internet 575 

    3.     OnClick  cbTables  . 

    if  cbTables.Texto''   then With  taWeblSQL do begin 
    If Active   then  Close; 
    TableName:=cbTables.Items[cbTables.Itemlndex]; 
    dsWeblSQL.DataSet:=taWebISQL; 
    Open; end; 

            
.          
taWeblSQL,    . 
    4. ,    ,    
 sbGo    . 

    with  quWeblSQL  do  begin If Active  then Close; 
    if  taWeblSQL.Active   then  taWeblSQL.Close; SQL.Clear; 
    SQL.AddStrings(meQuery.Lines); dsWeblSQL.DataSet:=quWebISQL; If   
(CompareText(Copy(SQL.Text,1,4) , 'OPEN1)=0)   then  begin 
    taWeblSQL.TableName:=Trim(Copy(SQL.Text,6,30)); 
    dsWeblSQL.DataSet:=taWebISQL; 
    taWeblSQL.Open; 
    end  else   If   (CompareText(Copy(SQL.Text,1,4),'EXEC1)=0)   then  
ExecSQL else  Open; end; 

         SQL  quWeblSQL  
  ,    Lines  meQuery. 
   ,  ,    
:  ,       
 .       Open.  
 .   Open     ANSI SQL, WeblSQL  
       Select * FROM 
tablename.         . 
      Open    
cbTables,       dgdResults. 

      

    ,   ,       
.    ActiveX  ,  
       Web Deployment Options   
Project.    ,     
         Web-.  
  ActiveForm,   . 
    1.        WeblSQL.PAS,      
 WeblSQL.DPR. 
    2.     <Ctrl+F9>,      
  (    OCX). 
    3.     Project^Web Deployment Options. 
    4.       Web Deployment Options    
  .   Target dir, Target URL  HTML dir. Target 
dir  Delphi,    ActiveForm OCX. Target URL  
URL,     HTML-      
ActiveForm.         
  . HTML dir ,    
   HTML-. 
           Web-,   
  Target dir  HTML dir       
.          HTML-. 

    576	 IV.    

    ,     Web- Microsoft US,  
  . 

    Target  dir:   C:\inetpub\wwwroot 
    Target   URL:   / 
    HTML  dir:      C:\inetpub\wwwroot 

          HTML-    
   ,   URL    
 .        ,  
    .   ,    
      Web Deployment Options. 
      ActiveX       Web-, 
  ActiveX      Web-. 
       Web Deployment Options  
 . ,    : 

    Target dir: c:\mywebpages 
    Target URL: file:///:/mywebpages 
    HTML dir:  c:\mywebpages 

           HTML-  
   c:\mywebpages,   HTML-  
       . 
    5.       ,    
      Project^Web Deploy.   
  ActiveForm OCX   HTML-  
  ,      Web Deployment 
Options.	~"~ """ 

      

      
         ActiveForm, ,   
  Internet Explorer 3 ViewoOptions^Security   Enable 
ActiveX controls and plug-ins.  ActiveForm    
     ActiveX,   
HTML-,         
     ActiveX.	,  
        ,    
 NSAPI  ISAPI, ActiveForm     
Web-.   , -\_ Web-,  
   Delphi HTML-   Web-, 
   ActiveX.    ActiveX 
   IE 3.x  Microsoft,    
     Netscape Navigator  
 . - ,   Netscape  
 ActiveX,        Java  Java-. 
          NSAPI/ISAPI,  Web-   
   ,      , 
    TCP/IP.     
    ,        
http: //127 .  .  . 1/webisql. htm.     ,   
      ,      
 WeblSQL.OCX.        Yes 
  .  . 28.9 ,      
  . 
           SQL,   
   .  , ,   
  BDE,  ,   BDE    
  ,   Web-. 

     28.     Internet 19 Delphi 3   
/ 577 

        ActiveForm      
   ActiveX,      
,          Web.   
    Delphi      
Windows,      OCX.     
 Component^lmport ActiveX Conrtol. 
    . 28.9.  WebiSQL ActiveForm   Internet Explorer 3.x  
        Web-. 
     Microsoft IE 3.x    ActiveX   
OCCASHE,     Windows ( WINNT).    
    ActiveForm,     
,       OCCASHE,  IE 3.x   
-   . 
         ,    
Web-,    ActiveX,   
.       ,   
      ActiveX.  
 OCX   ,    
    ,    . 

      :    

             
(thin-client app),     Internet.  
  ,       
 (intranet)   . 

    578  IV.    

          ,      
.  ,  ,  ,     
    Delphi MASTAPP.  ,  
       MASTAPP 
(EDORDERS.PAS).   EDORDERS   ,   
 BDE.           
MASTAPP   -,      . 

      
    I:          
 Delphi.    ,    
  .   ,    , 
  . 
            
    .     
      BDE,  ODBC   
 .  ,     
    ,   
     .     
   (application server)    
   .    
   -    
,      -   
  -   .  ,  
   . 
    ,     Orders  MASTAPP 
   ,  ,    
.           
  ,      
    .      
    ,      . 
         EDORDERS,   . 
    1.	   ,     
MASTDATA  MASTAPP. 
    2.	      ,   
 Provider. 
    3.	          
CUSTOMER, ORDERS, ITEM  
    PARTS   MASTDATA. 
    4.	 -,     -. 
    5.	        EDORDERS  
SRCHDLG  MASTAPP. 
    6.	          MASTDATA 
 MASTAPP. 
    7.	     ClientDataSet,    
 DataSource. 
    8.      ClientDataSet   DataSource,  
DataSource   ,   . 
    9.        RemoteServer     
  -,  . 
    10.    ClientDataSet   ReportServer  
,    . 
    11.        ,  
   MASTDATA,      . 
    12.    "-"  , 
      . 
    13.   ,     
 EDORDERS,       MASTAPP. 
     . 28.10 ,      
 EDORDERS   . 
             
     . 

     28.     Internet	579 

            . 
     ,  Delphi 
      , TQuery, TDatabase  . 
     RemoteServer  ClientDataSet, 
       . 
    - TDataSet       
    TProvider.     
TProvider,     ( )  .  
 DataSet         
        Export...from data module. 

    . 28.10.    EDORDERS 

    Q    ,    , 
     -.    
 . 
    Q   RemoteServer        
. ,   ,   TDatabase, 
       .    
         
,    RemoteServer. 
    Q   ,      "-" 
  .       
 ,      . 
          ,    
,   ComputerName  RemoteServer.  
        
UNC (Universal Naming Convention). ,     
        .   
  (Wide Area Network)      
DCOM  OLEnterprise,      . 
    ,      ,     
    .   28.8-28.12   
     
    
    EDORDERS. 

    580  IV.    

      
              DFM, 
          
 (,  ).      
  -, 

     28.8.       ORDSRV. DPR 

    program ordsvr; 
    uses 
    Forms, 
    ordsvrOO in 'ordsvrOO.pas' (Forml}, 
    ordsvr_TLB in 'ordsvr_TLB.pas', 
    ordsvrOl in 'ordsvrOl.pas' (dmOrders: TDataModule} {dmOrders: CoClass}, 
    DataMod in 'D:\Program Files\Borland\Delphi 
3\Demos\DB\MASTAPP\Datamod.pas' {MastData: TDataModule}; 
    {$R *.RES} {$R *.TLB} 
    begin 
    Application.Initialize; 
    Application.CreateForm(TForml, Forml); 
    Application.CreateForm(TMastData, MastData); 
    Application.Run; end. 
    
     28.9.      dmOrder  ORDSRV 

    unit ordsvrOl; interface 
    uses 
    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 
ComServ, ComObj, VCLCom, StdVcl, BdeProv, DataBkr, ordsvr_TLB, Provider; 
    type 
    TdmOrders = class(TDataModule, IdmOrders) 
    prOrders: TProvider; 
    prltems: TProvider; 
    prParts: TProvider; 
    prCust: TProvider; private 
    { Private declarations } public 
    { Public declarations } protected 
    function Get_prOrders: IProvider; safecall; 
    function Get_prltems: IProvider; safecall; 
    function Get_prParts: IProvider; safecall; 
    function Get_prCust: IProvider; safecall; end; 
    var 
    dmOrders: TdmOrders; 
    implementation uses DataMod; {$R *.DFM} 

     28.     Internet 581 

    function TdmOrders.Get_prOrders: IProvider; begin 
    Result := prOrders.Provider; end; 
    function TdmOrders.Get_prltems: IProvider; begin 
    Result := prltems.Provider; end; 
    function TdmOrders.Get_prParts: IProvider; begin 
    Result := prParts.Provider; end; 
    function TdmOrders.Get_prCust: IProvider; begin 
    Result := prCust.Provider; end; 
    initialization 
    TComponentFactory.Create(ComServer, TdmOrders, 
    Class_dmOrders, ciMultilnstance); end. 

      
       ORDSRV      .  
       .    
      ,     , 
          
Program Reset  Run Delphi. 
     ,   MASTDATA    MASTAPP 
 .         
 , 

     28.10.      ORDCLIENT . DPR 

    program ordclient; 
    uses Forms, 
    EDOrders in 'Edorders.pas' {EdOrderForm}, SrchDlg in 'SrchDlg.pas' {SearchDlg}; 
    ($R *.RES} 
    begin 
    Application.Initialize; 
    Application.CreateForm(TEdOrderForm, EdOrderForm); 
    Application.CreateForm(TSearchDlg, SearchDlg); 
    Application.Run; end. 

     28.11.       
  EDORDERS . PAS  MASTAPP 

    unit EDOrders; interface 
    uses 
    SysUtils, Windows, Messages, Classes, Graphics, Controls, 

    582  IV.    

    Dialogs, Forms, StdCtrls, DBGrids, DBCtrls, DBTables, DB, Buttons, Grids, 
DBLookup, ExtCtrls, Mask, DBClient, ComCtrls; 
    type 
    TEdOrderForm = class(TForm) HeaderPanel: TPanel; ShipToAddlEdit: TDBEdit; 
ShipToAdd2Edit: TDBEdit; CustAddlEdit: TDBEdit; CustAdd2Edit: TDBEdit; 
ShipToCompanyEdit: TDBEdit; CustCityEdit: TDBEdit; CustStateEdit: TDBEdit; 
CustZipEdit: TDBEdit; ShipToCityEdit: TDBEdit; ShipToStateEdit: TDBEdit; 
ShipToZipEdit: TDBEdit; Modelndicator: TLabel; POEdit: TDBEdit; TermsCombo: 
TDBComboBox; PaymentCombo: TDBComboBox; ShipViaCombo: TDBComboBox; Speedbar: 
TPanel; DBNavBtns: TDBNavigator; DBEditBtns: TDBNavigator; ActiveSource: 
TDataSource; ItemsGrid: TDBGrid; AmountPaidEdit: TDBEdit; TotalEdit: TDBEdit; 
TaxTotalEdit: TDBEdit; FreightEdit: TDBEdit; AmountDueEdit: TDBEdit; 
TaxRateEdit: TDBEdit; CloseBtn: TButton; CancelBtn: TButton; PostBtn: TButton; 
Image1: Image; PrintBtn: TSpeedButton; SoldByCombo: TDBLookupComboBox; 
Bevell: TBevel; DBTextl: TDBText; CustNoEdit: TDBEdit; dsOrders: TDataSource; 
dsltems: TDataSource; dsCustomer: TDataSource; csOrders: TClientDataSet; 
csltems: TClientDataSet; csCust : TClientDataSet; csParts : TClientDataSet; 
dsParts: TDataSource; RemoteServerl: TRemoteServer; csOrdersOrderNo: 
TFloatField; csOrdersCustNo: TFloatField; csOrdersSaleDate: TDateTimeField; 
csOrdersShipDate: TDateTimeField; csOrdersEmpNo: TIntegerField; 
csOrdersShipToContact: TStringField; csOrdersShipToAddrl: TStringField; 
csOrdersShipToAddr2: TStringField; csOrdersShipToCity: TStringField; 
csOrdersShipToState: TStringField; csOrdersShipToZip: TStringField; 
csOrdersShipToCountry: TStringField; csOrdersShipToPhone: TStringField; 
csOrdersShipVIA: TStringField; 

     28.     Internet 583 

    csOrdersPO: TStringField; 
    csOrdersTerms: TStringField; 
    csOrdersPaymentMethod: TStringField; 
    csOrdersItemsTotal: TCurrencyField; 
    csOrdersTaxRate: TFloatField; 
    csOrdersFreight: TCurrencyField; 
    csOrdersAmountPaid: TCurrencyField; 
    csOrdersTaxTotal: TCurrencyField; 
    csOrdersAmountDue: TCurrencyField; 
    csItemsOrderNo: TFloatField; 
    csItemsItemNo: TFloatField; 
    csItemsPartNo: TFloatField; 
    csItemsQty: TIntegerField; 
    csItemsDiscount: TFloatField; 
    csIternsDescription: TStringField; 
    csItemsSellPrice: TCurrencyField; 
    csItemsExtPrice: TCurrencyField; 
    DateTimePickerl: TDateTimePicker; 
    SaleDateEdit: TDBEdit; 
    csOrdersCustCompany: TStringField; 
    DBLookupComboBoxl: TDBLookupComboBox; 
    procedure ItemsGridEnter(Sender: TObject); 
    procedure ActiveSourceStateChange(Sender: TObject); 
    procedure ItemsGridExit(Sender: TObject); 
    procedure CancelBtnClick(Sender: TObject); 
    procedure PostBtnClick(Sender: TObject); 
    procedure PickPartNo(Sender: TObject); 
    procedure PickDate(Sender: TObject); 
    procedure PrintBtnClick(Sender: TObject); 
    procedure SaleDateEditKeyPress(Sender: TObject; var Key: Char); 
    procedure OrdersSourceStateChange(Sender: TObject); 
    function DataSetApplyUpdates(DataSet: TDataSet; Apply: Boolean): Boolean; 
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); 
    procedure SoldByComboKeyPress(Sender: TObject; var Key: Char); 
    procedure csOrdersCalcFields(DataSet: TDataSet); 
    procedure csItemsCalcFields(DataSet: TDataSet); 
    procedure FormShow(Sender: TObject); 
    procedure dsOrdersDataChange(Sender: TObject; Field: TField); 
    procedure DateTimePickerlExit(Sender: TObject); 
    procedure SaleDateEditDblClick(Sender: TObject); 
    procedure CloseBtnClick(Sender: TObject); public 
    procedure Enter; 
    procedure Edit(OrderNo: Double); end; 
    var 
    EdOrderForm: TEdOrderForm; 
    implementation uses SrchDlg; ($R *.DFM} 
    const 
    DatasetStates: array[TDataSetState] of string = 
    ('Not active', 'Browsing', 'Editing', 'Inserting', '', '', '', '', '', '') 
    HelpTopicEdit = 2; HelpTopicBrowse = 3; 
    { ==================   
    procedure TEdOrderForm.Enter; 

    584  IV.    

    begin 
    dsOrders.OnStateChange := OrdersSourceStateChange; try 
    csOrders.Open; csOrders.Insert; ShowModal; finally 
    dsOrders.OnStateChange := nil; end; end; 
    procedure TEdOrderForm.Edit(OrderNo: Double); begin 
    dsOrders.OnStateChange := OrdersSourceStateChange; try 
    csOrders.Open; 
    csOrders.Locate('OrderNo', OrderNo, []); ShowModal; finally 
    dsOrders.OnStateChange := nil; end; end; 
    { ======================     ====================== } 
    {        Orders  
Items     ActiveSource. } 
    procedure TEdOrderForm.ItemsGridEnter(Sender: TObject); begin 
    ActiveSource.Dataset := csltems; end; 
    procedure TEdOrderForm.ItemsGridExit(Sender: TObject); begin 
    ActiveSource.Dataset := csOrders; end; 
    {        "Active" 
 . } 
    procedure TEdOrderForm.ActiveSourceStateChange(Sender: TObject); begin 
    with ActiveSource do begin 
    if Dataset <> nil then Modelndicator.Caption := 
    Format('[%S: %S]', [Dataset.Name, DatasetStates[State]]); if State in 
[dsEdit, dslnsert] then begin 
    HelpContext := HelpTopicEdit; Modelndicator.Font.Color := clRed; end" else begin 
    HelpContext := HelpTopicBrowse; Modelndicator.Font.Color := clBlue; end; 
end; end; 
    {         . } 
    procedure TEdOrderForm.OrdersSourceStateChange (Sender: TObject); 
    begin 
    end; 

     28.     Internet	585 

    {      . } 
    procedure TEdOrderForm.PickDate(Sender: TObject); 
    begin 
    end; 
    {  <Ctrl+Enter>  SaleDate     PickDate. } 
    procedure TEdOrderForm.SaleDateEditKeyPress(Sender: TObject; var Key: 
Char); begin 
    if Key = AJ then begin 
    PickDate(Sender); Key := #0; end; end; 
    {    PartNo      PickPartNo. } 
    procedure TEdOrderForm.PickPartNo(Sender: TObject); begin 
    if ItemsGrid.SelectedField = csItemsPartNo then { PartNo column only } begin 
    if csItemsPartNo.Value <> 0 then 
    SearchDlg.PartNo := csItemsPartNo.Value; { start with current PartNo } if 
SearchDlg.ShowModalParts = mrOk then begin 
    csltems.Edit; 
    csItemsPartNo.Value := SearchDlg.PartNo; end; end; end; 
    {    BeforePost  AfterPost. } 
    procedure TEdOrderForm.PostBtnClick(Sender: TObject); begin 
    csOrders.Post ; end; 
    {       Orders. } 
    procedure TEdOrderForm.CancelBtnClick(Sender: TObject); 
    begin 
    //  csOrdersAfterCancel(csOrders); 
    csOrders . Cancel/end; 
    {  .      . } 
    procedure TEdOrderForm.PrintBtnClick(Sender: TObject); begin 
    if (Application.MessageBox('Print image of this form window? 
','',MB_YESNOCANCEL)=IDYES) then Print; end; 
    function TEdOrderForm.DataSetApplyUpdates(DataSet: TDataSet; Apply: 
Boolean): Boolean; begin 
    Result := True; 
    with TDBDataSet(DataSet) do 
    begin 
    if (State in dsEditModes) or UpdatesPending then begin 
    if Apply then 

    586  IV.    

    begin 
    Database.ApplyUpdates ( [DataSet as TDBDataSet]); { Always call 
CancelUpdates to remove any discard changes } CancelUpdates; end else begin 
    if (MessageDlg('Unsaved changes, exit anyway?', mtConfirmation, [mbYes, 
mbCancel], 0) = mrYes) then CancelUpdates else 
    Result := False; end; end; end; end; 
    procedure TEdOrderForm.FormCloseQuery(Sender: TObject; 
    var CanClose: Boolean); begin 
    CanClose := True; //DataSetApplyUpdates(csOrders, ModalResult = mrOK); end; 
    procedure TEdOrderForm.SoldByComboKeyPress(Sender: TObject; var Key: 
Char); begin 
    if not (Key in [#13, 127]) then 
    Key := #0; end; 
    procedure TEdOrderForm.csOrdersCalcFields(DataSet: TDataSet); begin 
    csOrdersTaxTotal.Value := csOrdersItemsTotal.Value * 
(csOrdersTaxRate.Value / 100); 
    csOrdersAmountDue.Value := csOrdersItemsTotal.Value + 
csOrdersTaxTotal.Value + 
    csOrdersFreight.Value - csOrdersAmountPaid.Value; end; 
    procedure TEdOrderForm.csItemsCalcFields(DataSet: TDataSet); begin 
    csItemsExtPrice.Value := csItemsQty.Value * 
    csItemsSellPrice.Value * (100 - csItemsDiscount.Value) / 100; end; 
    procedure TEdOrderForm.FormShow(Sender: TObject); begin 
    ActiveSource.DataSet:=csOrders; end; 
    procedure TEdOrderForm.dsOrdersDataChange(Sender: TObject; Field: TField); begin 
    PostBtn.Enabled := csOrders.State in dsEditModes; 
    CancelBtn.Enabled := PostBtn.Enabled; 
    CloseBtn.Enabled := csOrders.State = dsBrowse; end; 
    procedure TEdOrderForm.DateTimePickerlExit(Sender: TObject); begin 
    DateTimePiekerI.Visible:=False; 
    csOrders.Edit; 
    csOrdersSaleDate.AsDateTime:=Trunc(DateTimePicker1.Date); 
    SaleDateEdit.Visible:=True; end; 
    procedure TEdOrderForm.SaleDateEditDblClick(Sender: TObject); 

     28.     Internet	587 

    begin 
    SaleDateEdit.Visible:=False; 
    DateTimePickerl.Date:=csOrdersSaleDate.AsDateTime; 
    DateTimePickerl. Visible:=True; end; 
    procedure TEdOrderForm.CloseBtnClick(Sender: TObject); begin 
    Close; end; 
    end. 

     28.12.       SRCHDLG. 
PAS  

    unit SrchDlg; interface 
    uses 
    SysUtils, Windows, Messages, Classes, Graphics, Controls, 
    Forms, Dialogs, DBTables, DB, StdCtrls, ExtCtrls, Grids, DBGrids, Buttons, 
    DBClient; 
    type 
    TSearchDlg = class(TForm) DataSource: TDataSource; DBGridl: TDBGrid; 
OKBtn: TButton; CancelBtn: TButton; SearchEd: TEdit; OrderCombo: TComboBox; 
Label1: TLabel; Label2: TLabel; SearchButton: TSpeedButton; csCust: 
TClientDataSet; rsOrders: TRemoteServer; csParts: TClientDataSet; 
csPartsPartNo: TFloatField; csPartsVendorNo: TFloatField; csPartsDescription: 
TStringField; csPartsOnHand: TFloatField; csPartsOnOrder: TFloatField; 
csPartsCost: TCurrencyField; csPartsListPrice: TCurrencyField; csCustCustNo: 
TFloatField; csCustCompany: TStringField; csCustAddrl: TStringField; 
csCustAddr2: TStringField; csCustCity: TStringField; csCustState: 
TStringField; csCustZip: TStringField; csCustCountry: TStringField; 
csCustPhone: TStringField; csCustFAX: TStringField; csCustTaxRate: 
TFloatField; csCustContact: TStringField; csCustLastlnvoiceDate: 
TDateTimeField; procedure DBGridlDblClick(Sender: TObject); procedure 
SearchButtonClick(Sender: TObject); procedure OrderComboChange(Sender: TObject); 
    procedure SearchEdKeyPress(Sender: TObject; var Key: Char); procedure 
SearchEdChange(Sender: TObject); private 

    588  IV.    

    SrchFld: TField; 
    function GetCustNo: Double; 
    procedure SetCustNo(NewCustNo: Double); 
    function GetPartNo: Double; 
    procedure SetPartNo(NewPartNo: Double); public 
    property PartNo: Double read GetPartNo write SetPartNo; 
    property CustNo: Double read GetCustNo write SetCustNo; 
    function ShowModalCust: Integer; 
    function ShowModalParts: Integer; end; 
    var 
    SearchDlg: TSearchDlg; 
    implementation {$R *.DFM} 
    function TSearchDlg.GetCustNo: Double; begin 
    Result := csCustCustNo .Value/end ; 
    procedure TSearchDlg.SetCustNo(NewCustNo: Double); begin 
    csCust.Locate('CustNo', NewCustNo, []); end; 
    function TSearchDlg.GetPartNo: Double; begin 
    Result := csPartsPartNo.Value; end; 
    procedure TSearchDlg.SetPartNo(NewPartNo: Double); begin 
    csParts.Locate('PartNo', NewPartNo, []); end; 
    function TSearchDlg.ShowModalCust: Integer; begin 
    OrderCombo.Items.Clear; 
    OrderCombo.Items.Add('Company'); 
    OrderCombo.Items.Add('CustNo'); 
    OrderCombo.Itemlndex := 0; 
    Datasource.Dataset := csCust; 
    OrderComboChange(nil); 
    Caption := 'Select a Customer'; 
    Result := ShowModal; end; 
    function TSearchDlg.ShowModalParts: Integer; begin 
    OrderCombo.Items.Clear; 
    OrderCombo.Items.Add('Description'); 
    OrderCombo.Iterns.Add('PartNo'); 
    OrderCombo.Itemlndex := 0; 
    Datasource.Dataset := csParts; 
    OrderComboChange(nil); 
    Caption := 'Select a Part'; 
    Result := ShowModal; end; 
    procedure TSearchDlg.DBGridlDblClick(Sender: TObject); begin 

     28.     Internet 589 

    ModalResult := mrOK; end; 
    procedure TSearchDlg.SearchButtonClick(Sender: TObject); begin 
    if not Datasource.Dataset.Locate(OrderCombo.Text, SearchEd.Text, 
[loCaselnsensitive, loPartialKey]) then 
    MessageDlg('No matching record found.', mtlnformation, [mbOK] , 0) ; end; 
    procedure TSearchDlg.OrderComboChange(Sender: TObject); begin 
    SrchFld := Datasource.Dataset.FieldByName(OrderCombo.Text); 
    SearchEd.Text := ''; end; 
    procedure TSearchDlg.SearchEdKeyPress(Sender: TObject; var Key: Char); begin 
    if Assigned(SrchFld) and (Key > ' ') and not (SrchFld.IsValidChar(Key)) 
then begin 
    MessageBeep(0); Key := #0; end; end; 
    procedure TSearchDlg.SearchEdChange(Sender: TObject); begin 
    SearchButton.Enabled := SearchEd.Text <> ''; end; 
    end. 


      :   
        

      (shopping cart)      
  ,     Internet.   
     Web .       
   -    ,  ,   
  .        
   Windows,   Delphi,     
:      Windows 
"  "       World Wide 
Web.     . 
               
     Internet.     
    ,      
 .     ,    
  .    ,    
  Internet. 
      Internet      
,      .  
            
    .   Web,  
      ,  
  .  HTML-   
,     Web-  .  
 Java  ActiveX     
  .       
  . 
           
 HTML-,  Perl, JavaScript  CGI,  Java   
. ,       
        .  
  Delphi   ActiveForm. ActiveForm   
  Delphi,      ActiveX.  
    

    590  IV.    

    Delphi,   ,      Web-  
  ,    ActiveX ( 
    ActiveX   Internet 
Explorer  Microsoft). 
           , 
     3  4  .   3   
  ActiveForm,    4    
.        
 ActiveForm.       OCX  
   BDE      . 
              
 .        
 ,        
      .     
    . 
    1.   ,    InterBase . 
    2.        28.13  SQL,   
         .   
 ,        : \DATA\IB, 
     . 

      
      SQL       wiSQL 
File^Run an ISQL Script.          
 Delphi      -. 

     28.13.         
   

    CREATE DATABASE "C:\DATA\IB\SHOPCART.GDB" USER "SYSDBA" PASSWORD "masterkey"; 
    CREATE TABLE ITEM 
    (ItemNo int NOT NULL PRIMARY KEY, 
    Description char(30) NOT NULL, 
    Price decimal(5,2) NOT NULL); 
    CREATE TABLE CART (CustomerName char(30) NOT NULL, ItemNo int NOT NULL 
REFERENCES ITEM(ItemNo), CartDate date NOT NULL, Price decimal(5,2) NOT NULL); 
    CREATE TABLE DUAL (NoName char(1)); 
    CREATE VIEW TODAYCART AS SELECT * FROM CART WHERE CustomerName=USER AND 
CartDate="TODAY" WITH CHECK OPTION; 
    CREATE GENERATOR GEN_ITEMNO; 
    SET TERM !! ; 
    CREATE TRIGGER ITEM_INSERT FOR ITEM BEFORE INSERT 
    POSITION 0 AS BEGIN 
    NEW.ItemNo = GEN_ID(GEN_ITEMNO, 1) ; END! !  I 
    SET TERM ; !! 
    INSERT INTO ITEM (DESCRIPTION, PRICE) 
    VALUES ("DR. BUCK PHILGATE'S LINIMENT",29.95); 

     28.     Internet 591 

    INSERT INTO ITEM (DESCRIPTION, PRICE) VALUES ("ALLEN PUCK'S FALL ALERT",99.95); 
    INSERT INTO ITEM (DESCRIPTION, PRICE) 
    VALUES ("MRS. TUCK'S ICR MOOSE-OFF FOAM",23.95); 
    INSERT INTO DUAL VALUES ('X'); 

    3.      BDE IB_SHOPCART,      
.     BDE Administrator   Database Explorer. 
   InterBase   Decimal, ,  
  Enable BCD     True. 
    4.      File^New Application,    
 Delphi. 
    5.          Caption        
ShopCartServer,       

    WindowsState   wsMinimized. 

    6.      File^New      Remote Data 
Module    New Items. 
    7.     Remote Dataset Wizard    ShopCartServer  
   . -       
    DataSet   . 
    8.         Table    Query. 
   Table  taCART,    talTEM.  
Query  quUSERNAME.  taCART    CART  
  TODAYCART  . TODAYCART    
,     ,   
,    .    
,           
  ,     . 
    9.          Database  Session. 
    10.   AutoSessionName  Session   True. 
    11.   AliasName  Database   
   ; IB_SHOPCART.    
DatabaseName  dbSHOPCART. 
    12.   HandleShared  Database   True. 
    13.    DatabaseName  taCART, talTEM  
quUSERNAME  dbSHOPCART.       
     

    Database. 

    14.    TableName  taCART   
 TODAYCART,    ,    
28.13.    TableName  talTEM    ITEM. 
    15.   SQL  quUSERNAME   

    SELECT DISTINCT USER AS USERNAME FROM DUAL 

            . 
  TODAYCART      
 CustomerName (     ),  
       taCART    
   .     
  .     . 
    16.        DataSet (taCART, 
talTEM  quUSERNAME)       Export...from 
data module.        
 . 
    17.    .   Unit2   
 SCSERV01. PAS,  Unitl    SCSERVOO. PAS,     
 SCSERV. DPR. 
    18.    SCSERV,    
-.       . 

    592  IV.    

      ,       
 .    SHPCRT   . 
    1.     File^New Application,     Delphi. 
    2.      File^New^ActiveX^ActiveForm,    
 ActiveX.     ,      
  AcitveForm,       
ActiveX.    ,      ActiveX. 
    3.       ActiveX  SHOPCART,     
SHPCRT.DPR,       SHPCRTOO.PAS (. 28.11). 
    4.            ClientDataSet, 
  DataSource    RemoteServer. 
    5.       ClientDataSet  csCART,   
csiTEM    CSUSERNAME.      
     ShopCartServer. 
    6.       ServerName  RemoteServer  
SCSERV. ShopCartServer. 
    7.       RemoteServer    
ClientDataSet  RemoteServerl. 

    . 28.11.  ActiveForm Wizard      ActiveX 

    8.      csCART   taCART,  csiTEM  talTEM   
csUSERNAME  quUSERNAME.       
       

    ShopCartServer. 

    9.        CSCART,    , 
  <Ctrl+A>         
TODAYCART.      TField    TODAYCART. 
    10.     CSITEM    ,  
        ITEM. 
    11.     csUSERNAME    ,  
   

    USERNAME  quUSERNAME. 

     28.     Internet 593 

    12.   CSCART    Description.    
    Description  csITEM   
ItemNo.         . 
    13.     Af terOpen  CSCART   
 . 

    RefreshTotal; 

          Ref reshTotal.   
          
   - . 
    14.    Readonly  CSITEM  True.  
     .   
       , 
    ITEM. 
    15.    Active    ClientDataSet 
 True. 
    16.    DataSet  DataSourcel   csCART, 
   DataSet      CSITEM. 
    17.      DBGrid.     
  ,          
  40 .      350 . 
  DBGrid      . 
      ITEM   
,      . 
    18.   DBGrid  dbgCART,    dbgiTEM. 
    19.     Columns  dbgCART    
     .    ,  
 Description  Price,    ,  
CustomerName,           
     . 
    20.      Description   
Price,     . 
    21.    Readonly  dbgCART  True,  
   . 
    22.   Options   DBGrid,   
RowSelect.          
,    . 
    23.     DBGrid   DBNavigator  
   dbnCART.    VisibleButtons  , 
    nbFirst, nbPrior, nbNext, nbLast  nbDelete,   
     .     
     ,     
         
 . 
    24.     dbnCART      
  OnClick  . 

    If   (Button=nbDelete)   then RefreshTotal; 

       ,       
     . 
    25.    showHint  dbnCART  True.  
        . 
    26.    DataSource   DBGrid  
 DBNavigator  DataSourcel,     
    csCART. 
    27.    DataSource   DBGrid  
DataSource2,         CSITEM. 
    28.       DBGrid   
Label.      Label  Shopping Cart 
Contents,     Items. 
    29.   Label    DBNavigator.  
   Total:. 

    594	 IV.    

    30.    Total:     Label   
  laTotal.       Price  
dbgCART.          
       . 
    31.    Label     Height  
12 . 
    32.     Font    12   
   .      
   . 
    33.    Alignment  laTotal  
taRightJustify.         
Price,     ,     . 
    34.    dbglTEM  .     
btAdd,    btCheckOut.  btAdd     
    .  btCheckOut   
            
 . 
    35.    Caption  btAdd  Add Item to 
Shopping Cart,      btCheckOut  Check Out. 

     . 28.12 ,      . 

    . 28.12.     

        . 
    1.         Delphi   
    TShopCart. procedure  RefreshTotal; 
    2.      RefreshTotal     
TShopCart,     . 
    prodedure  TSHOPCART.RefreshTotal; var TempBM:   TBookmark; 

     28.     Internet 595 

    Total:   Currency; begin 
    with  csCART  do  begin TempBM:=GetBookmark; First; Total:=0; 
    While  not   eof  do  begin Total:=Total+csCARTPrice.Value; Next; end; 
    GotoBookmark(TempBM); FreeBookmark(TempBM) ; end; 
    laTotal.Caption:=FloatToStrF(Total,ffCurrency,6,2); end; 

             
        . 
    3.      ,   Panel     
dbg ITEM     paCheckOut.       
,           
DBGrid.          
    . 
    4.          Your order has been 
received. Thank you!      Visible  False. 
    5.         paCheckOut    
   Send To Back.       
     DBGrid  Label.   
        , 
  Visible   True,   Visible  
DBGrid  Label   False.    dbg ITEM  
    . 
    6.        btAdd      
OnClick  . 

    with csCART do begin 
    AppendRecord([csUSERNAMEUserName.Value, csITEMItemNo.Value, Date, csITEMPrice.Value 
    ]); 
    end; RefreshTotal; 

       AppendRecord  csCART   
    .  ,    
      UserName  
  csUSERNAME.      
  RefreshTotal      . 
    7.        btCheckOut      
  Delphi  . 


    btAdd.Visible:=False ; dbglTEM.Visible:=False; paCheckOut.Visible:=True; 
dbgCART.Enabled:=False; dbnCART.Enabled:=False, btCheckOut.Enabled:=False; 
csCART.ApplyUpdates(-1) ; 

      paCheckOut       
  ,       
      .   
ApplyUpdates    -1,       
      . 
    8.   ,    .    .  
. 28.13    SHOPCART. 

    596	 IV.    

         .     
 ,    ActiveForm    
Project^Web Deployment Options.      
 ,      OCX  ,   
   Web-,      
  .     ,   . 

    . 28.13.   SHOPCART 

    1.       <Ctrl+F9>,   . 
    2.      Project^Web Deployment Options. 
    3.    ,     Web Deployment 
Options,    Web-,     Target dir  
HTML dir       .    
  OCX    -. 
    ,     Web- Microsoft US,  
  . 

    Target   dir:   C:\inetpub\wwwroot 
    Target  URL:   / 
    HTML  dir:      C:\inetpub\wwwroot 

          HTML-    
   .  /  Target URL  
   IIS   . 
    4.       Additional Files      
   DBCLIENT.DLL.      
   BDE,    DBCLIENT . DLL     
.       Target URL  
Target directory,          . 
    5.         Options,   
 Project^Web Deploy   .     
 OCX   HTML-    ,  
    Web Deployment Options. 

     28.     Internet 597 

      ,   ,   
 ActiveX     Web-   
  Internet Explorer 3.0.     
   IE,       Web 
Deployment Options   . ,    : 

    Target dir: c:\mywebpages 
    Target URL: file:///.:/mywebpages 
    HTML dir:  c:\mywebpages 

           HTML-  
   : \mywebpages,   -  
       .    
 HTML-,   File^Open     
 IE   SHPCRT . . 
       ,   . 
    1.          Web-, 
,   . 
    2.      InterBase,     .    
    3.     Delphi  SHPCRT.HTM    
width  height  545  400 .     
Active Form       .    
  ,     HTML dir. 
    4.     Internet Explorer  SHPCRT.HTM.    
   Web-,      
Internet, : 

    http://localhost/shpcrt.htm 

     ActiveForm     Delphi,    
  . 
    1.   ActiveForm,     
,     Project^Web Deploy,     
,    . 
    2.   Run^Parameters    . 
    H^Host Application:   C:\Program FilesXPlus!\Microsoft  
Internet\Iexplore.exe	: t|Run parameters:   http://localhost/shpcrt .htm       
                                                                               
             f |t!      Web-. 
    3.   <F9>     Run,   
 ActiveForm.     Internet Explorer,     
  SHPCRT . . 
    5.      ,   Internet Explorer, 
, ,        
SHPCRT. OCX.    Yes   . 
    6.             
 .    InterBase  ,    
    SHOPCART (  SYSDBA  masterkey). 
    7.       btAdd,      
 ,         Delete .  
. 28.14 ,     . 
    8.      ,    btCheckOut.  . 28.15 
,          
 . 

    598  IV.    

    . 28.14.       

    . 28.15.       

     28.     Internet	599 

         ,  
 ActiveX,         
  .       ,   
    ,  Internet Explorer   
    ActiveX,     . 
      28.14-28.19      
 .  28.14.    SCSERV. DPR  
    

    program SCSERV; 
    uses Forms, 
    SCSERVOO in 'SCSERVOO.PAS' {Forml}, SCSERVJTLB in 'SCSERVJTLB.pas', 
SCSERV01 in 'SCSERV01.PAS' {ShopCartServer: TDataModule} {ShopCartServer: CoClass}; 
    {$R *.RES} {$R *.TLB} 
    begin 
    Application.Initialize; 
    Application.CreateForm(TForml, Forml); 
    Application.Run; end. 

     28.15.     SCSERVOO . DFM 
 SCSERV 

    object Forml: TForml 
    Left = 200 
    Top = 108 
    Width = 544 
    Height = 375 
    Caption = 'ShopCartServer' 
    Font.Charset = DEFAULT_CHARSET 
    Font.Color = clWindowText 
    Font.Height = -11 
    Font.Name = 'MS Sans Serif 
    Font.Style = [) 
    WindowState = wsMinimized 
    PixelsPerlnch = 96 
    TextHeight = 13 end 

     28.16.    SCSERVOI . DFM   
  ShopCartServ   

    object ShopCartServer: TShopCartServer Left = 200 Top = 108 Height = 234 
Width = 338 object taCART: TTable 
    DatabaseName = 'dbSHOPCART' 
    SessionName = 'Sessionl_2' 
    TableName = 'TODAYCART' 
    Left = 24 
    Top =16 end 

    600	 IV.    

    '''object talTEM: TTable 
    DatabaseName = 'dbSHOPCART' 
    SessionName = 'Sessionl_2' 
    TableName = 'ITEM1 
    Left = 72 
    Top =16 end object quUSERNAME: TQuery 
    DatabaseName = 'dbSHOPCART' 
    SessionName = 'Sessionl_2' 
    SQL.Strings = ( 
    'SELECT DISTINCT USER AS USERNAME FROM DUAL') 
    Left = 24 
    Top =72 end object Databasel: TDatabase 
    AliasName = 'IB_SHOPCART' 
    DatabaseName = 'dbSHOPCART' 
    HandleShared = True 
    Params.String   = ( 'USER NAME=SYSDBA') 
    SessionName = 'Sessionl_2' 
    Left = 120 
    Top = 16 end object Sessionl: TSession 
    Active = True 
    AutoSessionName = True 
    Left = 152 
    Top = 64 end end 

     28.17.    SHPCRT . DPR   
   

    library SHPCRT; 
    uses 
    ComServ, 
    SHPCRTJTLB in 'SHPCRTJTLB.pas', 
    SHPCRTOO in 'SHPCRTOO.pas' {SHOPCART: TActiveForm} {SHOPCART: CoClass}; 
    exports 
    DllGetClassObject, DllCanUnloadNow, DllRegisterServer, DllUnregisterServer; 
    {$R *.TLB} {$R *.RES} {$E ocx} 
    begin end. 

     28.18.     SHPCRTOO . PAS  
     

    unit SHPCRTOO; 
    interface 
    uses 

     28.     Internet 601 

    Windows,	Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 
    ActiveX,	AxCtrls, SHPCRT_TLB, Db, Grids, DBGrids, DBClient, StdCtrls, 
    DBCtrls,	ExtCtrls; 
    type 
    TSHOPCART = class(TActiveForm, ISHOPCART) 
    csITEM: TClientDataSet; 
    RemoteServerl: TRemoteServer; 
    dbgCART: TDBGrid; 
    dbglTEM: TDBGrid; 
    DataSourcel: TDataSource; 
    DataSource2: TDataSource; 
    btAdd: TButton; 
    Labell: TLabel; 
    Label2: TLabel; 
    csCART: TClientDataSet; 
    csCARTDESCRIPTION: TStringField; 
    LabelS: TLabel; 
    csITEMITEMNO: TIntegerField; 
    csITEMDESCRIPTION: TStringField; 
    csITEMPRICE: TBCDField; 
    btCheckOut:  TButton; 
    csCURTCUSTOMERNAME: TStringField; 
    csCARTCARTDATE: TDateTimeField; 
    csCARTPRICE: TBCDField; 
    csUSERNAME: TClientDataSet; 
    csUSERNAMEUSERNAME: TStringField; 
    dbnCART: TDBNavigator; 
    laTotal: TLabel; 
    paCHECKOUT: TPanel; 
    procedure btAddClick(Sender: TObject); 
    procedure btCheckOutClick(Sender: TObject); 
    procedure RefreshTotal; 
    procedure dbnCARTClick(Sender: TObject; Button: TNavigateBtn); 
    procedure csCARTAfterOpen(DataSet: TDataSet); private 
    { Private declarations } 
    FEvents: ISHOPCARTEvents; 
    procedure ActivateEvent(Sender: TObject); 
    procedure ClickEvent(Sender: TObject); 
    procedure CreateEvent(Sender: TObject); 
    procedure DblClickEvent(Sender: TObject); 
    procedure DeactivateEvent(Sender: TObject); 
    procedure DestroyEvent(Sender: TObject); 
    procedure KeyPressEvent(Sender: TObject; var Key: Char); 
    procedure PaintEvent (Sender: TObject); protected 
    { Protected declarations } 
    procedure EventSinkChanged(const EventSink: lUnknown); override; 
    procedure Initialize; override; 
    function Get_Active: WordBool; safecall; 
    function Get_AutoScroll: WordBool; safecall; 
    function Get_AxBorderStyle: TxActiveFormBorderStyle; safecall; 
    function Get_Caption: WideString; safecall; 
    function Get_Color: TColor; safecall; 
    function Get_Cursor: Smallint; safecall; 
    function Get_DropTarget: WordBool; safecall; 
    function Get_Enabled: WordBool; safecall; 
    function Get_Font: Font; safecall; 
    function Get_HelpFile: WideString; safecall; 
    function Get_KeyPreview: WordBool; safecall; 
    function Get_PixelsPerInch: Integer; safecall; 
    function Get_PrintScale: TxPrintScale; safecall; 
    function Get_Scaled: WordBool; safecall; 
    function Get Visible: WordBool; safecall; 

    602  IV.    

    function Get_WindowState: TxWindowState; safecall; 
    procedure Set_AutoScroll(Value: WordBool); safecall; 
    procedure Set_AxBorderStyle(Value: TxActiveFormBorderStyle); safecall; 
    procedure Set_Caption(const Value: WideString); safecall; 
    procedure Set_Color(Value: TColor); safecall; 
    procedure Set_Cursor(Value: Smallint); safecall; 
    procedure Set_DropTarget(Value: WordBool); safecall; 
    procedure Set_Enabled(Value: WordBool}; safecall; 
    procedure Set_Font(const Value: Font); safecall; 
    procedure Set__HelpFile(const Value: WideString); safecall; 
    procedure Set__KeyPreview(Value: WordBool); safecall; 
    procedure Set_PixelsPerInch(Value: Integer); safecall; 
    procedure Set_PrintScale(Value: TxPrintScale); safecall; 
    procedure Set_Scaled(Value: WordBool); safecall; 
    procedure Set_Visible(Value: WordBool); safecall; 
    procedure Set_WindowState(Value: TxWindowState); safecall; public 
    { Public declarations } end; 
    implementation uses ComServ; {$R *.DFM} { TSHOPCART } 
    procedure TSHOPCART.EventSinkChanged(const EventSink: lUnknown); begin 
    FEvents := EventSink as ISHOPCARTEvents; end; 
    procedure TSHOPCART.Initialize; begin 
    OnActivate := ActivateEvent; 
    OnClick := ClickEvent; 
    OnCreate := CreateEvent; 
    OnDblClick := DblClickEvent; 
    OnDeactivate := DeactivateEvent; 
    OnDestroy := DestroyEvent; 
    OnKeyPress := KeyPressEvent; 
    OnPaint := PaintEvent; end; 
    function TSHOPCART.Get_Active: WordBool; begin 
    Result := Active; end; 
    function TSHOPCART.Get_AutoScroll: WordBool; begin 
    Result := AutoScroll; 
    end; 
    function TSHOPCART.Get_AxBorderStyle: TxActiveFormBorderStyle; begin 
    Result := Ord(AxBorderStyle); end; 
    function TSHOPCART.Get_Caption: WideString; begin 
    Result := WideString(Caption); end; 

     28.     Internet 603 

    function TSHOPCART.Get_Color: TColor; begin 
    Result := Color; end; 
    function TSHOPCART.Get_Cursor: Smallint; begin 
    Result := Smallint(Cursor); end; 
    function TSHOPCART.Get_DropTarget: WordBool; begin 
    Result := DropTarget; end; 
    function TSHOPCART.Get_Enabled: WordBool; begin 
    Result := Enabled; end; 
    function TSHOPCART.Get_Font: Font; begin 
    GetOleFont(Font, Result); end; 
    function TSHOPCART.Get__HelpFile: WideString; begin 
    Result := WideString(HelpFile); end; 
    function TSHOPCART.Get_KeyPreview: WordBool; begin 
    Result := KeyPreview; end; 
    function TSHOPCART.Get_PixelsPerInch: Integer; begin 
    Result := PixelsPerlnch; end; 
    function TSHOPCART.Get_PrintScale: TxPrintScale; begin 
    Result := Ord(PrintScale) ; end; 
    function TSHOPCART.Get_Scaled: WordBool; begin 
    Result := Scaled; end; 
    function TSHOPCART.Get_Visible: WordBool; begin 
    Result := Visible; end; 
    function TSHOPCART.Get_WindowState: TxWindowState; begin 
    Result := Ord(WindowState); end; 
    procedure TSHOPCART.Set_AutoScroll(Value: WordBool); begin 
    AutoScroll := Value; end; 

    604  IV.    

    procedure TSHOPCART.Set_AxBorderStyle(Value: TxActiveFormBorderStyle); begin 
    AxBorderStyle := TActiveFormBorderStyle(Value); end; 
    procedure TSHOPCART.Set_Caption(const Value: WideString); begin 
    Caption := TCaption(Value); end; 
    procedure TSHOPCART.Set_Color(Value: TColor); begin 
    Color := Value; end; 
    procedure TSHOPCART.Set_Cursor(Value: Smallint); begin 
    Cursor := TCursor(Value); end; 
    procedure TSHOPCART.Set_DropTarget(Value: WordBool); begin 
    DropTarget := Value; end; 
    procedure TSHOPCART.Set_Enabled(Value: WordBool); begin 
    Enabled := Value; end; 
    procedure TSHOPCART.Set_Font(const Value: Font); begin 
    SetOleFont(Font, Value); end; 
    procedure TSHOPCART.Set_HelpFile(const Value: WideString); begin 
    HelpFile := String(Value); end; 
    procedure TSHOPCART.Set_KeyPreview(Value: WordBool); begin 
    KeyPreview := Value; end; 
    procedure TSHOPCART.Set_PixelsPerInch(Value: Integer); begin 
    PixelsPerlnch := Value; end; 
    procedure TSHOPCART.Set_PrintScale(Value: TxPrintScale); begin 
    PrintScale := TPrintScale(Value); end; 
    procedure TSHOPCART.Set_Scaled(Value: WordBool); begin 
    Scaled := Value; end; 
    procedure TSHOPCART.Set__Visible(Value: WordBool); begin 
    Visible := Value; end; 

     28.     Internet	605 

    procedure TSHOPCART.Set_WindowState(Value: TxWindowState) ; begin 
    WindowState := TWindowState(Value); end; 
    procedure TSHOPCART.ActivateEvent(Sender: TObject); begin 
    if FEvents <> nil then FEvents.OnActivate; end; 
    procedure TSHOPCART.ClickEvent(Sender: TObject); begin 
    if FEvents <> nil then FEvents.OnClick; end; 
    procedure TSHOPCART.CreateEvent(Sender: TObject); begin 
    if FEvents <> nil then FEvents.OnCreate; end; 
    procedure TSHOPCART.DblClickEvent(Sender: TObject); begin 
    if FEvents <> nil then FEvents.OnDblClick; end; 
    procedure TSHOPCART.DeactivateEvent(Sender: TObject); begin 
    if FEvents <> nil then FEvents.OnDeactivate; end; 
    procedure TSHOPCART.DestroyEvent(Sender: TObject); begin 
    if FEvents <> nil then FEvents.OnDestroy; end; 
    procedure TSHOPCART.KeyPressEvent(Sender: TObject; var Key: Char); var 
    TempKey: Smallint; begin 
    TempKey := Smallint(Key); 
    if FEvents <> nil then FEvents.OnKeyPress(TempKey); 
    Key := Char(TempKey); end; 
    procedure TSHOPCART.PaintEvent(Sender: TObject); begin 
    if FEvents <> nil then FEvents.OnPaint; end; 
    procedure TSHOPCART.btAddClick(Sender: TObject); begin 
    with csCART do begin 
    AppendRecord([csUSERNAMEUserName.Value, 
    csITEMItemNo.Value, 
    Date, 
    csITEMPrice.Value 
    ]); 
    end; end; 
    procedure TSHOPCART.btCheckOutClick(Sender: TObject); begin 
    btAdd.Visible:=False ; 
    dbglTEM.Visible:=False; 
    paCHECKOUT.Vis ible:=True ; 

    606	 IV.    

    dbgCART.Enabled:=False; dbnCART.Enabled:=False; btCheckOut.Enabled:=False; 
csCART.ApplyUpdates(-1) ; end; 
    procedure TSHOPCART.RefreshTotal; var 
    TempBM : TBookmark; Total : Currency; begin 
    with csCART do begin TempBM:=GetBookmark ; First; Total:=0; While not eof 
do begin 
    Total:=Total+csCARTPrice.Value; Next; end; 
    GotoBookmark(TempBM); FreeBookmark(TempBM); end; 
    laTotal.Caption:=FloatToStrF(Total, ffCurrency, 6,2); end; 
    procedure TSHOPCART.dbnCARTClick(Sender: TObject; Button: TNavigateBtn); begin 
    if (Button=nbDelete) then RefreshTotal; end; 
    procedure TSHOPCART.csCARTAfterOpen(DataSet: TDataSet); begin 
    RefreshTotal; end; 
    initialization 
    TActiveFormFactory.Create( ComServer, TActiveFormControl, TSHOPCART, 
Class_SHOPCART, I, 
    1 I 
    OLEMISC_SIMPLEFRAME or OLEMISC_ACTSLIKELABEL); end. 

     28.19.    SHPCRTOO . DFM  
    

    object SHOPCART: TSHOPCART Left = 200 Top = 108 Width = 544 Height = 391 
Caption = 'SHOPCART' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText 
Font.Height = -11 Font.Name = 'MS Sans Serif Font.Style = [] PixelsPerlnch = 
96 TextHeight = 13 object Labell: TLabel 
    Left = 40 
    Top = 168 

     28.     Internet	607 

    Width = 25 Height = 13 Caption = 'Items' end object Label2: TLabel 
    Left = 40 
    Top = 0 
    Width = 112 
    Height = 13 
    Caption = 'Shopping Cart Contents' end object Label3: TLabel 
    Left = 168 
    Top =  144 
    Width =46 
    Height = 20 
    Caption = 'Total: ' 
    Font.Charset = DEFAULT_CHARSET 
    Font.Color = clWindowText 
    Font.Height = -16 
    Font.Name = 'MS Sans Serif 
    Font.Style = [fsBold] 
    ParentFont = False end object laTotal: TLabel 
    Left = 216 
    Top =  144 
    Width =89 
    Height = 20 
    Alignment = taRightJustify 
    AutoSize = False 
    Caption = 'laTotal' 
    Font.Charset = DEFAULT_CHARSET 
    Font.Color = clWindowText 
    Font.Height = -16 
    Font.Name = 'MS Sans Serif 
    Font.Style = [fsBold] 
    ParentFont = False end object paCHECKOUT: TPanel 
    Left = 40 
    Top =168 
    Width = 361 
    Height = 161 
    Caption = 'Your order has been received.  Thank you!' 
    TabOrder = 5 
    Visible = False end object dbgCART: TDBGrid 
    Left = 40 
    Top =16 
    Width = 353 
    Height = 115 
    DataSource = DataSourcel 
    Options = [dgTitles, dglndicator, dgColumnResize, dgColLines, dgRowLines, 
dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit] 
    Readonly = True 
    TabOrder = 0 
    TitleFont.Charset = DEFAULT__CHARSET 
    TitleFont.Color = clWindowText 
    TitleFont.Height = -11 
    TitleFont.Name = 'MS Sans Serif 
    TitleFont.Style = [] 
    Columns = < item 

    608	 IV.    

    FieldName = 'DESCRIPTION' Readonly = False Width = 187 end item 
    FieldName = 'PRICE' Readonly = False end> end object dbglTEM: TDBGrid 
    Left = 40 
    Top = 181 
    Width = 353 
    Height = 145 
    DataSource = DataSource2 
    Options = [dgTitles, dglndicator, dgColumnResize, dgColLines, dgRowLines, 
dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit] 
    Readonly = True 
    TabOrder = 1 
    TitleFont.Charset = DEFAULT_CHARSET 
    TitleFont.Color = clWindowText 
    TitleFont.Height = -11 
    TitleFont.Name = 'MS Sans Serif 
    TitleFont.Style = [] end object btAdd: TButton 
    Left = 136 
    Top = 331 
    Width = 145 
    Height = 25 
    Caption = 'Add Item to Shopping Cart' 
    TabOrder = 2 
    OnClick = btAddClick end object btCheckOut: TButton 
    Left = 318 
    Top = 331 
    Width = 75 
    Height = 25 
    Caption = 'Check Out' 
    TabOrder = 3 
    OnClick = btCheckOutClick end object dbnCART: TDBNavigator 
    Left = 40 
    Top = 131 
    Width = 100 
    Height = 22 
    DataSource = DataSourcel 
    VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbDelete] 
    ParentShowHint = False 
    ShowHint = True 
    TabOrder = 4 
    OnClick = dbnCARTClick end object csITEM: TClientDataSet 
    Active = True 
    ProviderName = 'talTEM' 
    Readonly = True 
    RemoteServer = RemoteServerl 
    Left = 504 
    Top =48 
    object csITEMITEMNO: TIntegerField FieldName = 'ITEMNO' Required = True 

     28.     Internet	609 

    end 
    object csITEMDESCRIPTION: TStringField 
    FieldName = 'DESCRIPTION' 
    Required = True 
    Size = 30 end object csITEMPRICE: TStringField 
    FieldName = 'PRICE' 
    Required = True 
    Size = 2 end end 
    object RemoteServerl: TRemoteServer Connected = True 
    ServerGUID = ' {F7486762-4E2C-11D1-81BD-444553540000} Left = 464 Top = 8 end 
    object DataSourcel: TDataSource DataSet = csCART Left = 504 Top = 216 end 
    object DataSource2: TDataSource DataSet = csITEM Left = 504 Top = 256 end 
    .object csCART: TClientDataSet Active = True ProviderName = 'taCART' 
RemoteServer = RemoteServerl AfterOpen = csCARTAfterOpen Left = 504 Top = 8 
object csCARTCUSTOMERNAME: TStringField 
    FieldName = 'CUSTOMERNAME' 
    Size = 30 end object csCARTITEMNO: TIntegerField 
    FieldName = 'ITEMNO' end object csCARTCARTDATE: TDateTimeField 
    FieldName = 'CARTDATE' end object csCARTPRICE: TBCDField 
    FieldName = 'PRICE' 
    Size = 2 end object csCARTDESCRIPTION: TStringField 
    DisplayWidth = 36 
    FieldName = 'DESCRIPTION' 
    LookupDataSet = csITEM 
    LookupKeyFields = 'ITEMNO' 
    LookupResultField = 'DESCRIPTION' 
    KeyFields = 'ITEMNO' 
    Lookup = True end end 
    object csUSERNAME: TClientDataSet Active = True 
    ProviderName = 'quUSERNAME' RemoteServer = RemoteServerl Left = 504 Top = 96 

    610	 IV.    

    object csUSERNAMEUSERNAME: TStringField FieldName = 'USERNAME' Size = 31 
end end end 

     

    Delphi         
  Internet.  Delphi        
           
 ,    Active-Form   
  ISAPI/NSAPI.  WebBroker Delphi  
 ,       
  Web,     ,    , 
   ,   . 

     ... 

      29, " ",   
   Delphi,    
InstallShield Express   ,    
,       
 /. 

     28.     Internet	611 

