########################################################## # GDIdb demo script (c) 1997 Global Data Industries # Datasource=workweb.mdb (Access database) # # If you have a large table of data that you'd like to # split across several HTML pages, study this script # for hints on how to do it. ########################################################## ########################################################## # Declare & initialise variables used in script &defvar(?var1?,?categorysize?,?pagenum?,?ptot?,?lcount?,?tmp?) &assign(?pagenum?,1) ########################################################## # ?categorysize? sets the amount of jobs that are placed # on each page. try changing the value from 3 to 4 to see # the effect. &assign(?categorysize?,3) ########################################################## # Print the script information screen &cls &print("WorkWeb 3 Demo Script") &print("------------------------------------") ########################################################## # Declare the database file. &datasource("Driver={Microsoft Access Driver (*.mdb)};DBQ=workweb.mdb") ########################################################## # Start generating the HTML &html("index.html") { Work Web





# select all of the data in the "jobs" table &sql("SELECT * FROM Jobs") { &assign(?ptot?,?recordsetsize?/?categorysize?) # only create job pages & links if the database # actually contains some vacancies! &if(?recordsetsize?>0) { Select a link:
      # repeat this block as long as there is still data # to process &loop(?recordsetsize?>?rownumber?) { &assign(?var1?,?rownumber?+?categorysize?-1) Jobs ?rownumber?-?var1?
      # create a page with ?categorysize? number of # jobs on it (by calling subroutine &datapage) &datapage }
} # if there's no data in the database, print a sorry message &else { Sorry!
The database is currently empty.
} }
This Site demonstrates the use of GDI's Database publishing software. A database consisting of a large table of jobs is broken down into manageable chunks before being merged with the web site HTML and passed to the web server automatically.



System Bullet points:
  • Totally automated publishing of database and spreadsheet data using a dial-up Internet connection.
  • The database does not need to be stored on the web server.
  • No specialist knowledge is required by web site maintainer.
  • Zero administration overhead- Just set the times/days when you want to update your web site from your database and forget it!


Web site design by:
GLOBAL DATA INDUSTRIES
} ########################################################## # Print finished message & dialog &msgbox("Script finished!") &cls &print("HTML generation complete. Click the Preview HTML button to view the results.") &print &print # END OF SCRIPT ########################################################## # SUBROUTINES ############################################################ # The following subroutine is used to generate the DATA HTML # pages (The pages linked to the top-level page) &defsub("datapage") { # Print progress message &print("Processing Jobs ?rownumber?-?var1?") &html("content?pagenum?.html") { Jobs ?rownumber?-?var1?
Jobs ?rownumber?-?var1?
# this variable is used as the page count, and is incremented # after each page. &inc(?pagenum?) } }