Nomad and HTTP and CGI, Oh My! |
Part I: Introduction |
Wouldn't it be great if you could fire up Visual Basic (Or Excel or VBScript or any other product/language that supports ActiveX objects) and write standard VB code to get Nomad Data into a Windows 95 application?
Well, You Can!
The code below is a complete Visual Basic program that will fill a ListBox with all the Movie Titles from the sample FILMS database in 2 seconds! Live from a Nomad database on a VM system; not a static data snapshot.
Private Sub Form_Load() Dim ngGateway As New NomadGateway Dim rsFilmDetail As Nomad.Recordset ngGateway = "192.168.37.42" Set rsFilmDetail = ngGateway.OpenRecordSet _ ("Select * from Detail where FilmName <> ''") While Not rsFilmDetail.EOF lstFilms.AddItem rsFilmDetail!FilmName rsFilmDetail.MoveNext Wend rsFilmDetail.CloseMe End Sub
That's it, pretty standard Visual Basic data access code. Remove the references to Nomad, change rsFilmDetail.CloseMe to rsFilmDetail.Close and this program could be accessing SQL data via ODBC instead! Caveat: This is not ODBC for VM Nomad, but it is close enough (on a source code level) for me.
Of course there are many layers of technology to get here. We've got VB using TCP/IP to talk to a VM webserver that's using Rexx Sockets to implement HTTP to accept CGI requests that use CMS Pipelines to funnel Nomad Data back down the stream to VB, whew! But, it's really not that hard to do! We just have to connect all the pieces that have already been prepared for us! Like building a bird house from a kit, it's so much easier when you don't have to grow the trees and mill the lumber yourself. It's even easier when someone cuts the pieces and puts them in a bag with nails and glue for you!
Well, here's your bag of nails and glue! Let's start by reading the materials list.
A word about VM Webservers:
Webshare has been enhanced and refined into a
commercial product called Shadow VM Webserver and it is available from
NEON System.
Aonix has added Nomad specific tools to Enterprise/Web and is
selling a turn-key Nomad/Web package called RP/Web.
This series of articles will be geared towards Webshare but the
concepts will transfer to either of the commercial products.
Feel free to send questions or other feedback to me, also drop me a line if you'd like e-mail notification of new installments in this series. |