Is Paradox a good front-end for MySql?



Similar documents
Version of this tutorial: 1.06a (this tutorial will going to evolve with versions of NWNX4)

Specifications of Paradox for Windows

Working with SQL Server Integration Services

Knocker main application User manual

DiskPulse DISK CHANGE MONITOR

Access Queries (Office 2003)

FileMaker 12. ODBC and JDBC Guide

Database Concepts (3 rd Edition) APPENDIX D Getting Started with Microsoft Access 2007

Developing Web Applications for Microsoft SQL Server Databases - What you need to know

Migrating helpdesk to a new server

2874CD1EssentialSQL.qxd 6/25/01 3:06 PM Page 1 Essential SQL Copyright 2001 SYBEX, Inc., Alameda, CA

Access Tutorial 8: Combo Box Controls

DbSchema Tutorial with Introduction in SQL Databases

FileMaker 13. ODBC and JDBC Guide

Toad for Data Analysts, Tips n Tricks

2Creating Reports: Basic Techniques. Chapter

Microsoft Access Basics

Sophos Enterprise Console Auditing user guide. Product version: 5.2

How-To: MySQL as a linked server in MS SQL Server

Chapter 4 Accessing Data

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1

Connect to MySQL or Microsoft SQL Server using R

FileMaker 11. ODBC and JDBC Guide

Installation & User Guide

Teradata SQL Assistant Version 13.0 (.Net) Enhancements and Differences. Mike Dempsey

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute

Database Studio is the new tool to administrate SAP MaxDB database instances as of version 7.5.

The software shall provide the necessary tools to allow a user to create a Dashboard based on the queries created.

HELP DESK MANUAL INSTALLATION GUIDE

You can choose to install the plugin through Magento Connect or by directly using the archive files.

Microsoft Visual Studio Integration Guide

Using SQL Server Management Studio

Business Intelligence Getting Started Guide

Developing Own Crystal Reports

Microsoft Access 3: Understanding and Creating Queries

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

Aradial Installation Guide

INTRODUCTION: SQL SERVER ACCESS / LOGIN ACCOUNT INFO:

Tips and Tricks SAGE ACCPAC INTELLIGENCE

PROJECT ON MICROSOFT ACCESS (HOME TAB AND EXTERNAL DATA TAB) SUBMITTED BY: SUBMITTED TO: NAME: ROLL NO: REGN NO: BATCH:

Introduction to Microsoft Access 2003

XMailer Reference Guide

Integrated Virtual Debugger for Visual Studio Developer s Guide VMware Workstation 8.0

Abstract. For notes detailing the changes in each release, see the MySQL for Excel Release Notes. For legal information, see the Legal Notices.

Appointment Scheduler

Siemens Applied Automation Page 1 11/26/03 9:57 PM. Maxum ODBC 3.11

IceWarp Server. Log Analyzer. Version 10

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries

Attix5 Pro Server Edition

ScriptLogic File System Auditor User Guide

Getting Started - The Control Panel

IBM FileNet eforms Designer

Learn how to create web enabled (browser) forms in InfoPath 2013 and publish them in SharePoint InfoPath 2013 Web Enabled (Browser) forms

Creating Database Tables in Microsoft SQL Server

Moxa Device Manager 2.3 User s Manual

Data Generator for SQL Server User's Manual EMS Database Management Solutions

1 Minimum system requirements

USER GUIDE Appointment Manager

Using ODBC with MDaemon 6.5

Search help. More on Office.com: images templates

Table of Contents SQL Server Option

ECDL. European Computer Driving Licence. Database Software BCS ITQ Level 1. Syllabus Version 1.0

DB Administration COMOS. Platform DB Administration. Trademarks 1. Prerequisites. MS SQL Server 2005/ Oracle. Operating Manual 09/2011

Release Bulletin Sybase ETL Small Business Edition 4.2

TZWorks Windows Event Log Viewer (evtx_view) Users Guide

Patch Management Table of Contents:

VeriCentre 3.0 Upgrade Pre-Installation and Post Installation Guidelines

Hamline University Administrative Computing Page 1

ScriptLogic File System Auditor Agent Configuration Getting Started Guide

Facebook Twitter YouTube Google Plus Website

DataPA OpenAnalytics End User Training

Migrating MS Access Database to MySQL database: A Process Documentation

SQL Server An Overview

PTC Integrity Eclipse and IBM Rational Development Platform Guide

Business Insight Report Authoring Getting Started Guide

Microsoft Query, the helper application included with Microsoft Office, allows

"SQL Database Professional " module PRINTED MANUAL

ReportBy ODBC Connection setup

MICROSOFT ACCESS 2003 TUTORIAL

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

How to move a SQL database from one server to another

DbSchema Tutorial with Introduction in MongoDB

Ocean Data Systems Ltd. The Art of Industrial Intelligence. Dream Report GETTING STARTED. User- Friendly Programming-Free Reporting for Automation

CHAPTER 23: USING ODBC

Robot SCHEDULE 12 User Guide

InstantSearch+ for Magento Extension

Using Microsoft Access Front End to NIMSP MySQL Database

Building A Web Database Using Contextual Mode

PUBLIC. How to Use in SAP Business One. Solutions from SAP. SAP Business One 2005 A SP01

Using the ihistorian Excel Add-In

Jet Data Manager 2012 User Guide

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";! SET time_zone = "+00:00";!

DIPLOMA IN WEBDEVELOPMENT

Installation and Operation Manual Unite Log Analyser

enicq 5 System Administrator s Guide

Bitrix Site Manager 4.1. User Guide

Microsoft Office 2007 Orientation Objective 1: Become acquainted with the Microsoft Office Suite 2007 Layout

Upgrading MySQL from 32-bit to 64-bit

Transcription:

Is Paradox a good front-end for MySql? Caution Be aware that some functionalities of Paradox concerning non standard alias (ODBC and SQL) are broken with the Service Pack 2 of windows XP. You can check if you are in XP SP2 by executing the command winver (Menu Start/execute). If the end of the version information is «Service Pack 2» you are in SP2. The problem is tied to some Corel dialog box with the alias listbox where you can not more select a non standard alias. Examples of such dialog box: Menu File/Open /Table, Menu File /New/Query, Menu tools / Utilities Concerning SQL tables please note that the SQL editor is not concerned nor the Visual query builder. For a table access we can build a form (not with the expert) or use Proview, for a QBE we can create a new datamodel and then create a QBE based on that. OPAL access is not concerned by this problem. Hopefully Corel will quickly provide a patch For this document I ve worked in windows XP SP1 Installation of the mysql driver - Find and install the package «MyOdbc» from mysql web site. I ve used MyOdbc standard 3.51.9 the latest stable version. There is a 3.52 for test. Due to some problem I ve found on Datetime field I ve also tested the old 2.5 MyOdbc. You can work with both driver installed - Now you can find the MySql Odbc driver in the windows Odbc panel Menu Start / Parameter / Control Panel / Administration tools / Data Source (ODBC) Create a DNS System entry Verify in BDE Administrator this connection Menu Start / Parameter / Control Panel / BDE Administrator.We can save here the DATABASE NAME,USER NAME,SQLQRYMODE parameter.(you should also check Auto ODBC = True in configuration/system/init) Paradox and MySql Page 1 sur 17 Côme de Christen

Firsts tests Connecting from Paradox to an existing MySql table in an existing database We can use PhpMyAdmin as our first MySql administration tool for a simple installation. Consider a simple database named mydb with one table mytable and several fields : Now open Paradox 10 Menu File / Open / Table, choose TestMySql in the alias box You should now be able to open the mytable table Paradox and MySql Page 2 sur 17 Côme de Christen

Working with a MySql table Hit <F9> and enter our first record : Field Value Comment ID 1 Is it possible to specify an autoincrement value? YES! LastName Smith First Name Paul Birthday 25/06/1964 I enter the date in my French format and IT WORKS! Amount 10000.53 Again I enter the number with my format and IT WORKS! Comment Trying to store a small text in a MySql TEXT field. How this will work? Can we make a new paragraph? YES! Is it possible to make a find/replace (right mouse CLIC)? I ask to replace "clic" with "CLIC" and... IT WORKS! <F2> <SHIFT F2> Easy isn t it? Now is it possible to see the blob content each time I reach a record? Let see, Right mouse clic on the Comment field / Property then check the Blob content display and... IT WORKS! LastUpdate (DateTime) 15:52:46, 14/10/2004 (space bar) An error occur : another user is editing this record Then I try to delete the field and post the record and a new error : field required Tested in MyOdbc 3.5 and 2.5 LastUpdate (Timestamp) 15:52:46, 14/10/2004 The same error occur randomly (by default and space bar ) Tested in MyOdbc 3.5 and 2.5 LastUpdate (Time) 15:52:46 (space bar) Same error in 3.5, OK in 2.5 Any other problem? Well at least one, the Paradox project viewer can not deal with SQL alias (not related to the XP SP2 bug), well we can use Proview a freeware/shareware from Vladimir Menkin http://members.fortunecity.com/menkin/ Paradox and MySql Page 3 sur 17 Côme de Christen

Classical operations on tables in interactive mode Now let us compare Paradox and phpmyadmin for common table tasks. PhpMyAdmin is really good in that part Paradox and MySql Page 4 sur 17 Côme de Christen

Task Paradox PhpMyAdmin Rename a table Not Possible for SQL table Possible Copy a table An error occur (Incorrect field type) Possible (with MyODBC 2.52 the field type is not respected ) Empty a table Possible Possible Delete a table Possible Possible Sort by any column Not possible without a query Possible Filter on alpha fields Possible Possible (Select) * Filter on integer or numeric fields Possible Possible (Select) * Filter on date fields Not possible without a query Possible (Select) * * you don t have to enter the SQL yourself Quick transfert between Paradox and MySql tables If your Field type are simple the easiest way is to use the Copy tool utility in Paradox : Menu tool / Utilities / Copy This tool let you choose a local alias for your Paradox tables and a SQL alias for your MySql ones. Both way are handled : Paradox to MySql or MySql to Paradox. Paradox and MySql Page 5 sur 17 Côme de Christen

Query with QBE Paradox has here a little advantage, his QBE will generate an «ANSWER» table that can be reuse. In phpmyadmin by default you receive the result on screen. Not so simple to reuse the answer (but possible via an export or a temp table). Another big advantage for Paradox, the ability to visualy join tables and to make calculation or concatenation. But each new version of phpmyadmin comes with real new features Task Paradox PhpMyAdmin Selection of fields Possible Possible Criteria >, <, =, >=, <=, LIKE Possible Possible Criteria!= (Not) Possible Possible Sort on one field ASC, DESC Possible Possible Sort on several fields Possible Possible Change the fields order in the answer Possible Possible Join tables Possible Not in real QBE (possible in SQL) Auto. Mode possible with InnoDB table using foreign key and new «pmadb option» Make some calcul (SUM,MIN,AVG ) Possible Not in real QBE (possible in SQL) Update records with criterias Possible Not Possible (Possible with SQL) Delete records with criteras Possible Not Possible (Possible with SQL) Paradox and MySql Page 6 sur 17 Côme de Christen

Query with SQL Both products let you write SQL query but Paradox help you with a modern Visual Query Builder : Note : If you try to use directly the SQL code created by Paradox from a QBE (Menu View/View SQL) it will not work since the alias is not used. You ll have to select the SQL alias in the Alias listbox in the SQL toolbar. Sometimes an SQL alias is included inside the SQL text and it will not work either! On the other side PhpMyadmin will simply let you write your SQL query or use the search fonction («QBE») but this mode will not help you with the jointure between tables Paradox and MySql Page 7 sur 17 Côme de Christen

SQL passthrough or not? In some cases Paradox will run your query locally (with the BDE SQL parser) : - Mixing local and remote tables (an heterogeneous query), QBE or SQL will always run locally - More than one remote alias, QBE or SQL will always run locally - In others case you can control how your query will run in the property dialog If you can it is preferable to run the query remotely for better performance and in order to benefit of all MySQL functionalities. With the local mode you are limited by the BDE possibilities. Import / Export Paradox can easily export a local table (DB,DBF) resulting from a query on any SQL Server (Menu File/Export) Paradox can also execute a remote SQL query : SELECT INTO OUTFILE (cf MySql documentation) For the importation we will have to work in 2 pass, import the data in a local table and then copy the data to MySql (or we could write an OPAL script reading a file line by line and inserting them in MySql), so not so simple. PhpMyAdmin is really good in this area : Paradox and MySql Page 8 sur 17 Côme de Christen

Others good utilities of phpmyadmin Data Dictionary and print view of table Paradox and MySql Page 9 sur 17 Côme de Christen

Paradox Forms and reports directly bounded to Mysql From this point phpmyadmin will be useless as we will explore some unique feature of Paradox. His ability to build quickly forms and reports even on remote Sql data. Forms A first try with the expert (so without any manual change) and hop it works and quite quickly! Reports A first test with the expert without any change and one minute after Paradox and MySql Page 10 sur 17 Côme de Christen

But then can we mix our MySql tables with some Paradox one? Well yes! And use some calculated field? Well yes! Using SQL in OPAL on MySql tables Minimal example Var Db Database daparams DynArray[] String Q1 Sql EndVar daparams["username"] = "root" daparams["password"] = "" if not db.open("testmysql",daparams) then MsgStop("Error!","Can t open Database") Return Q1 = Sql SELECT * FROM mytable EndSql if not Q1.executeSQL(db,":Priv:Reponse") then MsgStop("Error!","Can t execute Query 1") return if not db.close() then MsgStop("Error!","Can t close Database") Return Paradox and MySql Page 11 sur 17 Côme de Christen

Others important points We can centralize recurrent code in a library LibSQL.lsl Var db Database endvar method ConnectSQL() Logical Var daparams Dynarray[] String EndVar daparams["username"]="root" daparams["password"]="" if not db.open("testmysql",daparams) then errorshow("erreur! Impossible d'accéder à la base") return False return True method CloseSQL() Logical if not db.close() then errorshow("impossible de fermer la base") Return False Return true method ExecSQL(sSQL String) Logical Var Q1 SQL EndVar Q1 = Sql ~ssql EndSQL if not executesql(db,q1,":priv:reponse") then errorshow("erreur! Impossible d'exécuter la requête.") return False return True method GetUiDataFromSQL(sSQL String,vUi UiObject) Logical Var Q1 SQL TcRep,TcUi TCursor EndVar Paradox and MySql Page 12 sur 17 Côme de Christen

Q1 = Sql ~ssql EndSQL if not executesql(db,q1,tcrep) then errorshow("erreur! Impossible d'exécuter la requête.") return False TcUi.attach(vUi) if not TcUi.empty() then errorshow("erreur! Impossible d'initialiser le traitement.") return False if not TcRep.add(TcUi,True,False) then errorshow("erreur! Impossible d'exécuter la requête.") return False return True Using SQL query we can also work on local Paradox table populated on demand On this working example we have copied a mysql table (sal) to a local Paradox one SAL.DB, that was the easy part with the Paradox Copy utility. Now we want to build a form which can extract data from MySql on our local Paradox table but also which can update all local change back to MySql Paradox and MySql Page 13 sur 17 Côme de Christen

At the form level we have in this example Var Lib Library ssql String endvar Uses ObjectPal "LibSQL.lsl" enduses method MasterUpdate() ssql="update sal SET Civil = '"+Civil+"', Nom = '"+Nom+"', Prenom = '"+Prenom+"' WHERE NoAgent = '"+NoAgent+"'" if not Lib.ExecSQL(sSQL) then MsgStop("Erreur!","Impossible de mettre à jour les données sur le serveur") return method MasterInsert() ssql="insert INTO sal (NoAgent,Civil,Nom,Prenom) VALUES ('"+NoAgent+"','"+Civil+"','"+Nom+"','"+Prenom+"')" if not Lib.ExecSQL(sSQL) then MsgStop("Erreur!","Impossible de mettre à jour les données sur le serveur") return method MasterDelete() ssql="delete FROM sal WHERE NoAgent = '"+NoAgent+"'" if not Lib.ExecSQL(sSQL) then MsgStop("Erreur!","Impossible de supprimer les données sur le serveur") return method action(var eventinfo ActionEvent) if eventinfo.isprefilter() then ;// Ce code s'exécute pour chaque objet de la fiche ;// Ce code s'exécute seulement pour la fiche actionid = eventinfo.id() switch case actionid = dataunlockrecord : switch case self.recordstatus( "Modified" ) and not self.recordstatus( "New" ) : Paradox and MySql Page 14 sur 17 Côme de Christen

MsgInfo("Vue :","Mise à jour...") MasterUpdate() case self.recordstatus( "New" ) : MsgInfo("Vue :","Insertion...") MasterInsert() endswitch case actionid = datadeleterecord : MsgInfo("Vue :","Suppression...") MasterDelete() EndSwitch endif method close(var eventinfo Event) if eventinfo.isprefilter() then ;// Ce code s'exécute pour chaque objet de la fiche ;// Ce code s'exécute seulement pour la fiche Lib.CloseSQL() Lib.close() method menuaction(var eventinfo MenuEvent) if eventinfo.isprefilter() then ;// Ce code s'exécute pour chaque objet de la fiche ;// Ce code s'exécute seulement pour la fiche ;// Forcer la validation si fermeture de fiche ;// Without this code you will lose your last change on the form close! if eventinfo.id()=menucanclose and isedit() then action(dataendedit) method open(var eventinfo Event) if eventinfo.isprefilter() then ; Ce code s'exécute pour chaque objet de la fiche. ; Ce code s'exécute juste pour la fiche. Lib.open(":Local:LibSQL") if not Lib.ConnectSQL() then MsgStop("Erreur!","Impossible de se connecter à la base...") return Paradox and MySql Page 15 sur 17 Côme de Christen

method keyphysical(var eventinfo KeyEvent) if eventinfo.isprefilter() then ;// Ce code s'exécute pour chaque objet de la fiche if eventinfo.vchar()="vk_escape" then disabledefault NomRech.MoveTo() ;// Ce code s'exécute seulement pour la fiche endif On the search input field level we have method changevalue(var eventinfo ValueEvent) DoDefault ssql="select NoAgent,Civil,Nom,Prenom FROM sal WHERE Nom LIKE '"+NomRech+"%'" if not Lib.GetUiDataFromSQL(sSql,LSAL) then MsgStop("Erreur!","Impossible d'obtenir les données") return LSAl.Home() ;// LSAL is the tableframe On the t ableframe LSAL level we have method open(var eventinfo Event) LSal.empty() On the naviguation bar we have Nothing special, from left to right : active.action(databegin) active.action(datapriorrecord) active.action(datanextrecord) active.action(dataend) if isedit() then action(dataendedit) action(databeginedit) Paradox and MySql Page 16 sur 17 Côme de Christen

active.action(datasearch) active.action(datasearchnext) If not isedit() then action(databeginedit) active.action(datainsertrecord) NoAgent.MoveTo() Endmethod ;Confirmation if MsgQuestion("Suppression de l'enregistrement :","On continue?")<>"yes" then return ;Traitement action(databeginedit) active.action(datadeleterecord) action(dataendedit) close() On the key field NoAgent we have (We do not allow changing our key value) method changevalue(var eventinfo ValueEvent) if Self<>"" then Disabledefault MsgInfo("Message :","Vous ne devez pas modifier ce champ.") If working with Linux be careful with case sensitivity of MySql object If your SQL is SELECT * FROM SAL but your MySql table name is sal you ll get a MySql error Links Upsizing to client/server : ftp://ftp.corel.com/pub/paradox/pdoxwin/unindexed/cswhite.zip MySql documentation : http://dev.mysql.com/doc/mysql/en/index.html Easyphp : http://www.easyphp.org MyOdbc : http://www.mysql.com/products/connector/odbc/ PhpMyAdmin : http://www.phpmyadmin.net/home_page/ Paradox and MySql Page 17 sur 17 Côme de Christen