Lescasse Consulting
 Home    Company    News    Prices    Download    Buy    Forums   
Read Me
Buy
Forums
Resume
AntiSpam 1.2
wBackup 1.11
NetAccess 2.0
Visual APL 1.0 
APL+Win 8.0 
APL+Win Products 
APL+Win Objects™ 
APL+Win Training 
     • Packages
     • Feedback
     • World Map
     • Updates
     • Pack 1
     • Pack 2
     • Pack 3
     • Pack 4
     • Pack 5
     • Pack 6
     • Pack 7
     • Pack 8
     • Pack 9
     • Pack 10
     • Pack 11
     • Pack 12
     • Pack 13
     • Pack 14
APL+Web Services
APL+Web Component 
APL+ History
Dyalog.Net Tutorial
Conferences 
Powerpoint
White Papers
Web Hosting
References
Links
 
APL+Win Objects™ 6.0

TADO5
TADO5 Tutorial
TAPLDraw5
TAPLEdit5
TAPLSession5
TAbale5
TAboutBox5
TAccess5
TAgent5
TBlatMail5
TButton5
TCDO5
TCRC5
TCancelButton5
TCheck5
TCheckGroup5
TChildForm5
TChooseColor5
TChooseFont5
TClipBoard5
TClock5
TCodeStats5
TColors5
TCombo5
TComboDrive5
TComboFilter5
TComboList5
TComboTree5
TCommandBar5
TCommandButton5
TControlClass5
TCueCard5
TDHTML5
TDHTMLEditor5
TDateTime5
TDateTimeFr5
TDates5
TDemoHandlers5
TDisplay5
TDOS5
TDualSelect5
TEdit5
TEditAmount5
TEditDir5
TEditEnter5
TEditFile5
TEditGrid5
TEditList5
TEditListview5
TEditMenu5
TEditNum5
TEditSelect5
TEditSpin5
TEmail5
TError5
TExampleForm5
TExcel5
TExcel5 Tutorial
TFindReplace5
TFOne5
TFTP5
TFTP5 Tutorial
TFileCompare5
TFileMenu5
TFileMenuDef5
TFlatButton5
TForm5
TFormClass5
TFormEditor5
TFrame5
TGetDir5
TGif5
TGifForm5
TGifWb5
TGoMenu5
TGraphX5
TGrid5
TGridDisplay5
TGridPrint5
TGUID5
THLine5
THTML5
THTML5 Tutorial
THTTP5
THelp5
THelpMenu5
TImagelist5
TInfo5
TIniFile5
TInstall5
TInternet5
TJpg5
TJpgWb5
TLabel5
TList5
TListview5
TLock5
TLogs5
TMAPI5
TMath5
TMDIForm5
TMSOutlook5
TMaskEdit5
TMedia5
TMenu5
TMessage5
TModalCall5
TMsgBox5
TNavigator5
TNetwork5
TNonVisualClass5
TODBC5
TOKButton5
TObject5
TOpenFile5
TOption5
TOptionGroup5
TOutlook5
TOutlookMail5
TOWCSpread5
TPDF5
TPFKeys5
TPage5
TPassword5
TPicture5
TPing5
TPopupMenu5
TPowerpoint5
TPowerpoint5 Tutorial
TPrinter5
TProgress5
TProgressDlg5
TQuestion5
TRegistry5
TRegistryKey5
TResource5
TRichEdit5
TSPX5
TSQLDMO5
TScheduler5
TScroll5
TSelector5
TSpinner5
TSplitter5
TStatus5
TStopWatch5
TTest5
TTestError5
TTextFile5
TTimer5
TTip5
TTipForm5
TTLI5
TToolBar5
TToolbox5
TToolsMenu5
TTrackbar5
TTranslate5
TTree5
TVLine5
TViewMenu5
TWebBrowser5
TWebServer5
TWebSite5
TWebSiteNet5
TWinMenu5
TWord5
TYesNo5
    Visits:  1980 (38 on line) Last Update: Nov 23, 2003  
    APL+Win Training Pack 7    Printer Friendly  
Object Oriented Programming (continued)
Accessing ODBC Databases

Download APL+Win Training Pack 7 (793 K)

This APL+Win Training Pack explains how to start building your own class hierarchy of objects.

It contains:

  • a new version of the Qwi utility with a few enhancements
  • a template QwiNewClass function for creating new objects
  • a template QwiInherit function for creating new objects which inherit from an existing class

The Qwi utility has been improved so that all user defined class ultimately derive from a common Object class.

A first new class called Form is created: this class inherits from the standard APL+Win Form class to which it adds a number of new properties and methods.

Then a new FOne class is created: an FOne object is a form which contains a Formula One OCX object which knows how to resize itself when the form is resized and understands a number of general basic methods, needed with any from with a grid. The FOne object inherits from our Form class and therefore can use all of the Form class properties and methods.

In the second part of this APL+Win Training Pack, a new FOneODBC class of objects is developed. This class inherits from the FOne class and therefore from our Form class as well. An FOneODBC object is a form object which contains a Formula One OCX object and knows how to connect itself to any ODBC database, retrieve data from the database tables into the grid, show the database tables and columns structure, retrieve data to APL, update records in database tables, insert new records in the database tables, etc...

In this process of starting to build a class hierarchy, we are facing the challenges of Object Oriented Design. This APL+Win Training Pack includes detailed explanations about Object Oriented Analysis and Design.

A few dummy objects are added to our class hierarchy so that it looks like the following:


A few utilities are provided to complement the ODBC workspace:

  • the Tree function is a recursive utility which allows to draw a tree in APL
  • the ClassTree function analyzes a workspace and draws its class hierarchy tree

All subsrcibers to the APL+Win Training will be able to greatly benefit from the new Form and FOne classes. Yhey will be able to create their own child classes starting from Form and FOne.

But the major part of this APL+Win Training Pack is the FOneODBC object.

With this new object, you will be able to access ODBC databases from APL+Win and update them. This object in itself offers similar functionnalities as commercial products which cost as much as this whole APL+Win Training Program.

Let's quickly show how you can use this object:


      Œwself„'ff'
      Qwi 'New' 'FOneODBC' 'DemoShow'
      ds„ Qwi 'Connect' 'c:\windows\odbc\data sources\biblio97.dsn'
      rc„ Qwi 'Query' 'select * from authors'

The first instruction creates an instance of the FOneODBC object and shows it topmost in the upper right corner of the screen.

The second instruction connects it to the BIBLIO.MDB Access database.

The third instruction retrieves all records from the authors table into the FOneODBC grid.

The result is the following:



If you start changing cells by typing new data into them, the records are automatically and immediately updated in the BIBLIO.MDB Access database.

If you type in new records, all you need to do to insert them into the database table, is to invoke the FOneODBC Insert method:


      sink„ Qwi'Insert'

You can even use the FOneODBC object as a background engine to retrieve ODBC data directory to APL with the GetQuery and GetQueryVars methods:


      Qwi 'GetQuery' 'select	* from authors where au_id < 10'
1 Adams, Pat
2 Adrian, Merv
3 Ageloff, Roy         1943
4 Andersen, Virginia
5 Antonovich Michael P.
6 Arnott, Steven E.
7 Arntson, L. Joyce
8 Ault, Michael R
9 Avison, D. E.

      Qwi 'GetQueryVars' 'select * from authors where au_id < 10' au_id author year_born       au_id 1 2 3 4 5 6 7 8 9       author Adams, Pat Adrian, Merv Ageloff, Roy Andersen, Virginia Antonovich Michael P. Arnott, Steven E. Arntson, L. Joyce Ault, Michael R Avison, D. E.

Of course, at any time you can query the database tables and columns structure using the Tables and Columns methods:


      Qwi'Tables'
C:\APLBOOK\disk7\biblio  MSysACEs          SYSTEM TABLE
C:\APLBOOK\disk7\biblio  MSysColumns       SYSTEM TABLE
C:\APLBOOK\disk7\biblio  MSysIMEXColumns   SYSTEM TABLE
C:\APLBOOK\disk7\biblio  MSysIMEXSpecs     SYSTEM TABLE
C:\APLBOOK\disk7\biblio  MSysIndexes       SYSTEM TABLE
C:\APLBOOK\disk7\biblio  MSysMacros        SYSTEM TABLE
C:\APLBOOK\disk7\biblio  MSysModules       SYSTEM TABLE
C:\APLBOOK\disk7\biblio  MSysModules2      SYSTEM TABLE
C:\APLBOOK\disk7\biblio  MSysObjects       SYSTEM TABLE
C:\APLBOOK\disk7\biblio  MSysQueries       SYSTEM TABLE
C:\APLBOOK\disk7\biblio  MSysRelationships SYSTEM TABLE
C:\APLBOOK\disk7\biblio  Authors           TABLE
C:\APLBOOK\disk7\biblio  Publishers        TABLE
C:\APLBOOK\disk7\biblio  Title Author      TABLE
C:\APLBOOK\disk7\biblio  Titles            TABLE
C:\APLBOOK\disk7\biblio  All Titles        VIEW

      Qwi'Columns' 'authors'
C:\APLBOOK\disk7\biblio authors Au_ID      4 COUNTER  10   4  0  10 1 1
C:\APLBOOK\disk7\biblio authors Author    12 TEXT    255 255  0   0 1 2
C:\APLBOOK\disk7\biblio authors Year Born  5 SHORT     5   2  0  10 1 3

The FOneODBC object includes other methods and properties.


Pack 7 Content

DISK7.DOC A 76 pages Winword document containing Chapters 15 and 16 of the APL+Win Training.
ODBC.W3 A workspace allowing you to explore accessing ODBC databases in an Object Oriented fashion as well as utilities to explore a class hierarchy and several objects built in a small class hierarchy.
ODBCMIN.W3 The minimum set of functions required for the FOneODBC object to run.
 This entire Web site has been dynamically generated by APL+Win Objects™ 6.0
 For all questions contact:  info@lescasse.com
 Copyright © 2003-2005 Lescasse Consulting. All rights reserved.