WebSmart Code Samples
 

How this program was created.

  1. Select the "SQL Page at a time" template
  2. Unclick the options for adding, updating and deleting records
  3. Choose all other wizard defaults
  4. Add file XL_WEBDEMO/MU_ORDHF
  5. Choose to add another file and add XL_WEBDEMO/MU_CUSTF
  6. When it prompts you to create a link between the files, you can choose Cancel. Creating a link is not required because we are using SQL to access the files.
  7. For the subfile display:
    1. Add field OHORD from MU_ORDHF
    2. Add field CMNAME from MU_CUSTF
    3. Add field OHOTOT from MU_ORDHF
  8. For the full record display:
    1. Add field OHORD from MU_ORDHF
    2. Add field CMNAME from MU_CUSTF
    3. Add all other fields from MU_ORDHF
  9. On line 172, change the value of selstring to:
    selstring = "SELECT rrn(MU_ORDHF), OHORD, CMNAME, OHOTOT FROM MU_ORDHF, MU_CUSTF WHERE (OHCUST = CMCUST)";
    If you do not have line numbers enabled, you can do so by following this instructions:
    1. Go to the Tools menu at the top
    2. Choose Options
    3. Click the HTML tab
    4. Click the two Line Number checkboxes
  10. On line 259, change the sqlexec statement to:
    sqlexec("SELECT OHORD, OHDESC, CMNAME, OHORDT, OHSTAT, OHOTOT, OHTAX, OHWHSE, OHCUSH, OHSHPDT, OHINV INTO :OHORD, :OHDESC, :CMNAME, :OHORDT, :OHSTAT, :OHOTOT, :OHTAX, :OHWHSE, :OHCUSH, :OHSHPDT, :OHINV FROM MU_ORDHF, MU_CUSTF where ((rrn(MU_ORDHF)= :rrn) AND (OHCUST = CMCUST))");
  11. Compile the program and your done!


  This example was created using WebSmart.

www.excelsystems.com