Create a WebSnap program with delphi6: 1.File-> new-> Other-> Websnap-> Web Snap Application2. This is a prompt option, you can choose Isapi or WinCGi, Apache, etc., this is convenient for debugging, we choose WEB App Debugger Executable. (It is easy to change) 3. Note setting Coclass Name, if you don't use Isapi, this class name you should remember. Here I am set to indeex (Insidedelphi Example). 4. Set the corresponding HTML page name in PageName. This is set to indeex, and you can refer to Delphi Help for other parameters. Select OK to determine. 5. At this point, Delphi should have a simple data form box for us. But it can't display it at this time. (Select SaveAll to WEBSNAPEXAMPLE, if you select Run in IDE, then it should register this class. Select Tools-> Web App Debuger, then start, in order to see your class, you are in IE Try http: // localhost: 1024 (before this, I suggest you see the relevant document), of course, the premise is that you have installed IIS, then you should see a class, named WebsNapexample.Indeex, I have to eat, stay Continued) The following operations are done in INDEEX in the corresponding data module. The above module corresponds to Home. Then, the corresponding data module should be specified for the corresponding WebSNAP program. Next, add a corresponding method, similar to an interface in a COM program. Select New-> Other-> Websnap-> WebSNAPPAGEMOUDLE, select page name Method1, then remember to have 5 components. Connection, DataSet, DataSource, DataSetAdapter, AdapterPageProducer is required (provided you use ADO). I use 5 components as follows, because I don't like to use BDE, so use ADO. Adoconnection: In the ADO page adodataset: in the ADO page DataSource: In the DataAccess page AdapterPageProducer: on the WebSnap page. DataSetAdapter: On the WebSnap page. Add the corresponding data, change the loginprompt of AdoConnection to false, set the corresponding Adoconnection, Adodataset, set it to true. After setting, you must remember to press Right Select FieldSeditor on the corresponding Adodataset to add the corresponding field to Keep the DataSource component, point the DataSet property to the corresponding adodataset. Change the DataSetAdapter's DataSet. Change the data module's pageProducer to AdapterPageProducer. Then set up the properties of this AdapterPageProducer, which is white to edit its webpageItems properties.
Select New-> layoutGroup, then press Right on LayoutGroup1, select New Adapterform. On the corresponding Adapterform, we can create a number of objects, which will affect the layout of the web page. I want to put the corresponding adaptercommandgroup (corresponding to the components of the TDATANAVIGATOR that we often use) plus them. Note that let him have an effect, you must pay attention to the DisplayComponent property, which we set it to adaptergrid1 (later). If you look at a single record, you can add the corresponding AdapterFieldGroup object, change the ADAPTERFIELDGROUP1 DataSetAdapter to DataSetAdapter, note that you can have its AdapterMode property to edit or browse, modify. If you want to view the entire form, you can get an AdapterGrid on the Adapterform, which is equivalent to the DataGrid we have seen. Also sets Adapter and the corresponding AdapterMode property. Compiled, then, huh, I will tell a fall. If you want to add more methods, add new WebSnappageMoudle. Other (web design and distribution WebsNAPApplication) web pages in the corresponding program directory, direct Edit. When publishing WebSnap applications, you should copy the corresponding EXE (or ISAPI) and web pages to the same web directory. Note that the permissions must be permissions must be permissions at this directory. Then, use the / regserver registration to change the component in the command line. One of the WEBSNAPEXAMPLE / RSERVR. Run is: (make sure Debugger is running) http: // localhost: 1024 / Websnapexample.Indeex / method1 (because our data module is called Method1) Author: InsideDelphi