1 / 31

Working interactively with Microsoft Visual FoxPro

Working interactively with Microsoft Visual FoxPro. Welcome to SDE Rainer Becker. Rainer Becker. dFPUG Online offers Loose Leaf Magazine VFP-DevCon VFP-Lokal/Develop Framework Visual Extend MVP, MCP, ISV Wizards & Builders GmbH. Topics.

Download Presentation

Working interactively with Microsoft Visual FoxPro

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Working interactively with Microsoft Visual FoxPro Welcome to SDE Rainer Becker

  2. Rainer Becker • dFPUG • Online offers • Loose Leaf Magazine • VFP-DevCon • VFP-Lokal/Develop • Framework Visual Extend • MVP, MCP, ISV • Wizards & Builders GmbH

  3. Topics • DataExplorer –easy way to discover the datamodel and to run queries • Command Window – the control center mainly used for browsing data • Correct settings in Visual FoxPro 9.0 to avoid confusion within the team • Working with the View Designer to create/save basic SQL statements

  4. Data Explorer A visual tool to navigate in tables and to test SQL-statements

  5. How to call • Via Menu: • Tools -> TaskPane -> More • Via Command Window: • DO home() + „dataexplorer.app“ • … with „-M“ • Via Configuration File • config.fpw • command = do …

  6. Add a Connection • To a Database Container • To a Tables directory • To a Microsoft SQL-Server • (local) • over the Internet • available for VFP as a WebService

  7. Add Directories instead • Directories to Add: • adds all DBCs of given directory • does NOT add all tables of directory! • problem with free tables • not shown in directory view… • you can add them one by one… • we should move all of them to DBCs…

  8. Node Tables • Shows Table Names • Expands to Field Names • does not display comments • can display structure information • Options: Checkbox: Show Column Info • RightClick: Checkbox: Show Col Info • „Design“ for Structure Modification

  9. Run Query • Define Query • Run Query • Save Query • Copy Query to Clipboard • Copy Results to Clipboard • AddOn: Copy Results to Excel • if interesting code should be shown

  10. Node Stored Procedures • Unique Key Generation • GetNewKey() • Other Key Generation • SetSRSKey() • SetPDefKey() • SetPListKey()

  11. Node Views • View Definition • Browse Results • Run Query (select * from view…) • Design • New Views should be stored in a separate DBC as they otherwise will get lost with next application update!

  12. Command Window & Browse Window The non-visual interfacefor about everything butescpecially for browsing data

  13. Basic Directory commands • CD <directory> • MD <dir>, RD <dir> as well like DOS • SET PATH TO <dir,dir,dir> [ADDI] • search path for file-based commands • Results are shown in the Desktop • If not visible, use Outshow-Keycode • Ctrl+Shift+Alt (do not mix with Del)

  14. Basic Table commands • USE <table> • AGAIN SHARED or EXCLUSIVE • IN 0 (not yet used workarea) • ORDER <index tag name> • ALIAS <local name> • NOUPDATE (for read-only access!) • USE [IN <alias>] (to close one) • CLOSE TABLES (to close all)

  15. Exclusive Table commands • CREATE <table> • MODIfy STRUcture • non-exclusive if you just want to lock… • ZAP (remove all records) • PACK (remove deleted records) • never do this in Shark! First RECALL all records, delete/pack and then delefordel • REINDEX (recreate index)

  16. Basic Database Commands • OPEN DATAbase ? | <dbcname> • MODIfy DATAbase ? | <dbcname> • to view all tables / contents • automatically opens database • CLOSE DATAbase [ALL] • SET DATAbase TO <name> • to switch current database / see toolbar • VALIdate DATAbase [RECOVER]

  17. Table contents viewing • BROWse • NOCAptions (to show real field names) • FIELDS <field names> (to limit cols) • NOEDit (to prevent changes!) • use ESCape key if you changed by accident! • NODElete (to prevent deletions!) • FOR <complex condition(s)>

  18. Extended BROWSE • Resize/Rearrange with Mouse • Doubleclick for AutoFit of Columns • LEDIT/REDIT PARTITION for edit section in left/right part of grid • IN MACDESKTOP (for separate window) • Additional menu functions that sometimes might be helpfull

  19. Saving Browse Settings • SET RESOurce ON • Table FOXUSER created • BROW PREFerence <name> to load (or create if first time) a setting • Close with Ctrl+Q to not save changes • or just use BROWse LAST to restore last configuration…

  20. Contents Filtering • FOR <complex condition> • as long as based on current table! • relational filtering needs an additional step like: • and seek( <column>, „<otheralias>“, „order“) and <otheralias>.<fieldname> = <value> • very fast but for more complex filtering SQL has to be used!

  21. Split up Browse command • Use SET FIELDS TO beforehand to limit columns to be shown • Use SET FILTER TO beforehand to limit records to be shown • Use SET ORDER TO to set the order how the records are displayed • Use SET DELETED ON/OFF to show deleted records or not

  22. Other Stuff • Call command window with Ctrl+F2 • Show Desktop with Ctrl+Alt+Shift • Clear Desktop with CLEAR • Commands are logged and you can scroll back till last Cleanup command • Mark multiple lines and select „Execute Selection“ in rightlick-menu • End session with QUIT

  23. Settings / Options Ease your lifewith the correct environment settings

  24. Where to find • Directly enter in command window • Syntax: SET <XYZ> TO <val>/ON/OFF • Write into configuration file • modi file home() + „config.fpw“ • Syntax: <XYZ> = <val>/ON/OFF • Use Tools -> Options dialog • for permanent saving in the registry • if you select „Save as Default“ only!

  25. View Page • Status Bar • Clock • Command Results • System Messages • Optional: Last Project • Optional: MRU list to the max

  26. General Page • Cancel on Escape • Log compilation errors • Set Development on (compare time) • Confirm file replacement • Enter or tab to exit fields • Strict Date Level

  27. Data Page • NEVER open exclusive on Server! • show field names • prompt for code page • ignore deleted records • rushmore optimization • Collating Sequenze Machine • NO automatic file locking! • NO String comparison settings!

  28. File Locations Page • Default Directory • Search Path • include all your data directories • Optional: Start up program

  29. Regional Page • NEVER Use System Settings! • Date Format • Date Separator • Century ON • Decimal separator • 1000 separator • Week starts on / First week of Year

  30. Editor Page • Comment string should be the same • You might use syntax coloring • I always do …

  31. Recommendation • Settings should be the same for all team members that exchange SQL-statements to prevent confusion! • can be extractet from registry as a .reg-file, double-click applies settings locally • Never forget to Click „Save as Default“ before clicking „OK“ • Shift+OK copies settings as commands to open debugout window if debugger is open

More Related