Monday, July 16, 2012

An Introduction to the TBatchMove Component in Delphi and C++ Builder

An Introduction to the TBatchMove Component in Delphi and C++ Builder

Abstract: TBatchMove can move data between tables with the same database or a different database

 
Problem:
What is the TBatchMove component and how do I use it with InterBase 
(or any other database)?

Solution:
An Introduction to the TBatchMove component
=====================================

1. What is it?

TBatchMove is a VCL component that lets you perform operations on 
groups of records in a table. The operations are named with intuitive 
names that basically tell what they do.  

Listed below are the operations or "modes" that the TBatchMove 
component supports.  

- batAppend     => 
   appends all records from the source table to the end of the destination
   table.

- batAppendUpdate     =>  
   Appends all records from the source table to the end of the destination
   table and updates those records with the same primary index in the
   destination table with the same records from the source table.
 
- batCopy     =>  
  Copies a table and its records to a new table

- batDelete     =>  
  Delete all records in the destination table that also appear in the 
  source table.

- batUpdate      =>  
  Update existing records in the destination table with their counterparts
  in the source table.


2. How do I  use it?
Listed below are steps to setup and run a TBatchMove component to 
upsize Paradox data to InterBase.

a.  Put two TTable objects on the form, one for source and one for 
destination.
1. Click on "Data Access" tab.

2. Click on table icon.

3. Click on form.

4. Press  to go to the Object Inspector.

5. Define the Database property for table1 to be the BDE alias that 
points to the directory where Paradox tables are located.  In this case, 
we are using the DBDEMOS alias hat is installed by default when you 
do a full install of Delphi 3. 

6. Define the TableName property in object inspector for table1 to be the 
Paradox table name, In this example, the table name will be the "orders" 
sample table that comes with Delphi.  Since we have already specified the 
location of the tables, you can easily fill in the TableName property setting 
by selecting the table from the picklist of the TableName property.

7. Repeat steps 2.a.1 - 2.a.4 for table2

8. Define the database on table2 to be an alias that points to the InterBase
database, in this case employee.gdb, by selecting the BDE alias that points
to the employee database.

9. Define TableName  property for table2 to be the table name you want 
created in InterBase. For simplicity, call it "orders" as well.

10. Configre the TBatchMove component
a.   Put the  TBatchMove component on the form.
1. Click on the Mode property's edit box.

2. Click on the BatchMove icon.

3. Click on the form.

b.  Define the source and destination for TBatchMove
1. Hit  to go to the object inspector.

2. Set the Source property of TBatchMove to be table1.

3. Set the Destination property of TBatchMove to be table2.

d.   Specify the mode for TBatchMove
1.  Click on the Mode property's edit box.
2.  Click on the down arrow that appears to get a picklist of modes to 
     choose from.
3.  Click on  "batCopy" to select it from the list.

d. Activate TBatchMove 
1. Right click on TBatchMove component
2. Click on  "Execute" on the pop-up menu that appears.

e. What happens when TBatchMove fails?

You can tell TBatchMove to document what happened when you run 
a batch move operation by setting the following properties. They tell 
Delphi to create a local Paradox table containing records that were 
not successfully part of the batchmove operation.

ChangedTablename  => Records that were modified by the batch 
                                    move operation

KeyvioltableName  => Records that could not be added because they 
                                 violated a uniqueness constraint.

ProblemTableName  => Records that could not be added for one reason
                                   or another.

More at http://edn.embarcadero.com/article/25620

Thursday, March 1, 2012

How to transfer a Delphi Profile from One PC to another

Assuming that Delphi and the other VCLs are is installed in the same folder at the new PC, then the migration is fairly easy if you are comfortable working with regedit.

The information is stored in the Registry under  a key called HKEY_CURRENT_USER\Software\Borland\Delphi\5.0 or something like that. You'll find all the registration information under that key, including a list of installed packages.

Just export the keys to a registry file, copy it to the new computer and install it by double-clicking on it

Tuesday, September 27, 2011

What is FireMonkey?

What is FireMonkey?

FireMonkey is a native CPU and GPU powered application platform that makes it easy for developers to rapidly build visually engaging and data rich HD and 3D applications with blazing native performance on Windows, Mac and iOS.

What's behind the name FireMonkey?

2016 is the year of the FireMonkey in the Chinese calendar. FireMonkey brings with it extra energy and determination to reach far beyond your expectations. The FireMonkey is uniquely inventive and thinks out of the box.
We picked the name because our engineers have aimed high. They have done what many thought wasn't possible with our next generation application platform.
And finally because we like the name. We think it's fun. Smile

What programming languages do I use to develop FireMonkey applications?

You can program in either "RAD" C++ or Delphi, two easy to learn component based object oriented languages that are used by millions of developers worldwide. You can choose "RAD" C++ to use existing C++ or C-like language skill or to reuse existing ANSI C++ code in FireMonkey applications. Or you can choose Delphi, an elegant and easy to learn object oriented language.

How much does FireMonkey cost?

The FireMonkey platform itself doesn't cost anything. There are no deployment fees or runtime fees. Applications built with the FireMonkey platform can be distributed royalty free. To build FireMonkey applications, you need Delphi XE2, C++Builder XE2 or RAD Studio XE2. You can click here to learn more about these products or download a trial. FireMonkey applications

What is the difference between FireMonkey and RIA platforms like HTML5/CSS, Adobe Flash or Silverlight?

RIA platforms have rich free-form graphics, time based animation, and media capabilities that are well suited for web content, entertainment and advertising. Because RIA applications are typically web embedded, they use scripting and VM engines to execute program code. This provides cross-platform browser compatibility, but comes with a performance trade off. RIA platforms being entertainment focused are not designed around the needs for business applications. Things like enterprise data and services connectivity, business UIs and graphcis, and packaged and enterprise app distribution are not well served with RIA platforms.
FireMonkey is a native application platform, with many of the rich capabilities of RIA platforms such as vector graphics, 3D, animation, effect, and cross-platform but FireMonkey is focused on the unique needs of business, ISV, and industrial use software. FireMonkey is fully CPU and GPU native, UI oriented, and provides powerful database and services connectivity.

Is FireMonkey a gaming framework?

Not really. Unlike 3D frameworks such as Unity 3d, Unreal or Torque that specifically work on game development, FireMonkey is focused on the business or industry specific applications such as healthcare, automotive, aerospace and so on. But if you do wish to build a game with FireMonkey let us know, we'd love to play it!

What platforms does FireMonkey support?

You can build FireMonkey applications on Windows and deploy to Windows and Mac OSX. You can also build and deploy your applications to iOS – iPad, iPhone, iPod touch.

How fast are FireMonkey applications?

FireMonkey applications are 100% CPU and GPU native which means that your applications are executing directly in your hardware and not in software "engines". Application code runs full throttle in the CPU and graphics are executed by your GPU hardware. This means your FireMonkey business applications will run with "hardware level" performance that you simply cannot get from RIA platforms, virtual machine runtimes or dynamic languages.

Do FireMonkey applications require exotic hardware?

Not at all. FireMonkey is designed to run on any standard Intel based PC or Mac or ARM based iOS device such as iPhone, iPad, or iPod Touch. And FireMonkey GPU requirements are very modest, only requiring a DX9 level GPU also known as pixel shader level 2. In plain language, this means pretty much any display hardware shipped in the last 10 years.

Are there any events which I can attend to learn about FireMonkey?

Yes. You can attend our World Tour event series that started on August 2, 2011. You can also contact your local sales representative for more information.

How do I get more information or give my feedback?

You can join our forums on EDN, follow us on Twitter and Facebook. You can also contact your local sales representative for more information.

Saturday, July 23, 2011

Facebook and Delphi - Facebook API for Delphi By Zarko Gajic, About.com Guide July 19, 2011

in Facebook :: I guess you know what Facebook is? In simple words, Facebook is a social networking website intended to connect friends, family, and business associates. Users of Facebook can share news stories, video, and other files with friends. Here's a Facebook page you should "like" if you are interested in Delphi Programming About.com Delphi Programming on Facebook.'

Ok, so now that you know what Facebook is, you probably are asking how can I build a Delphi application to allow me and my friends to "connect" to Facebook more easily :)

You should be looking at the Facebook for Developers - allowing developers, for example, to build "Facebook apps" - web applications that are loaded in the context of Facebook.

Given that Delphi is a Win32 development environment, let's see if there are some libraries to help you build some Facebook apps (or anything Facebook-aware).

More at http://delphi.about.com/b/2011/07/19/facebook-and-delphi-facebook-api-for-delphi.htm

Sunday, July 17, 2011

What is Delphi XE ?

Delphi XE Key Features
  • RAD IDE with fast drag-and-drop design
  • More than 500 visual controls
  • Built-in touch and gesturing support
  • dbExpress with support for 9 major databases
  • DataSnap n-tier middleware with JSON, REST, HTTP, HTTPS, COM, and XML
  • Debugging support for multi-threaded applications
  • UML / code metrics and audits
  • Integrated tool chest for performance profiling and build automation
  • Subversion integration for source code management
  • Cloud deployment to Amazon EC2 and work with Windows Azure cloud data storage
  • Target Windows 2000, XP, Vista, and Windows 7 from single source
  • Access to previous Delphi versions (7, 2007-2010) included
  • Centralized license management and tool deployment with Embarcadero ToolCloud
Embarcadero® Delphi® XE is the fastest way to deliver ultra-rich, ultra-fast Windows applications. Dramatically reduce coding time and create applications 5x faster with component-based development and a fully visual two-way RAD IDE. Speed development across multiple Windows and database platforms – for GUI desktop applications, interactive touch-screen, kiosk, and database-driven multi-tier, cloud, and Web applications. With Delphi, you can:
  • Build applications faster with pre-built components and drag-and-drop visual design
  • Build applications that require speed-visualizing data, controlling hardware in real time, manipulating 3D objects, financial modeling, gaming, imaging, medical equipment, point-of-sale systems, and more
  • Future-proof your applications with native connectivity to 9 major databases and ready-made components for cloud connectivity
  • Utilize thousands of free and commercial components for user interfaces, database, multi-tier, web apps, industry specific and more
Delphi XE is available in Professional, Enterprise and Architect editions. For details on the differences between the editions, see the Product Editions page and Feature Matrix

Tuesday, October 26, 2010

How to Create a 32-bit ODBC Source in Windows 7/8/10 (Updated 2nd Jan 2017)

The VFP ODBC driver was included in MDAC 2.5 and earlier and preinstalled on Windows 2000 and earlier. In order to use it on Windows XP and later Windows versions, it has to be installed first. The Microsoft Visual FoxPro Driver 6.01.8629.01 is available for download at http://msdn.microsoft.com/en-us/vfoxpro/bb190233.aspx.

2016
The VFP ODBC Driver can be installed under 64-bit Windows but 64-bit applications cannot access VFP ODBC driver because it comes only in 32-bit version. For 32-bit applications under 64-bit Windows there's ODBC Data Source Administrator for the 32-bit ODBC drivers %systemdrive%\Windows\SysWoW64\odbcad32.exe (usually C:\WINDOWS\SysWOW64\odbcad32.exe).

2017

Important to remember that 64bits applications need to access 64 bits ODBC drivers.

Sunday, October 24, 2010

How to Migrate Delphi 5 from 1 PC to Another

What do you do when your PC crashes and you have to migrate your Delphi 5 + all installed VCL components to another PC ?

One possible solution is to restore all your folders to the replacement PC and then reinstall Delphi 5 + all the updates. Tedious but definitely workable but what if you have misplaced your original Delphi Install Disk ?

This is what I attempted to do :-

1. Copy the Delphi 5 folder to the new PC (for Win7 PCs, administrator rights must be given to this folder)

2. Copy  VCL*50.bpl from WINSYS32 folder to the BIN folder on the target PC.

3. Launch D5 and all you will see is the Standard Tab with only the Frames Icon visible.

4. Click Component/Install Packages and manually add applet50.bpl and you will see that the Borland Control Applet has been installed. By doing so, you will still no additional tabs on icons but when you click File/New..., all the tabbed dialog box will now be complete :-)

5. Then add dcl3150.bpl (D1 compatibilty components) and voila dclstd50.bpl (Borland Standard Componets) is also automatically installed.

6. Repeat for all dcl*.bpl

More to come...

Welcome to Delphi... Delphi... Delphi

I have been a Delphi Developer since Delphi 3 when I finally decided on Delphi in 1996 as my programming language of choice for the Windows 32 environment. So what have I created with Delphi ?

Would you believe that I had single-handedly created a full ERP2 system comprising ERP+CRM where ERP=Sales Distribution+MRP+ Procurement Management+Planning & Production +Finacial Management + Human Resources Management System.

Since 15th February 2009, we have visitors from more than 60 countries including Malaysia, United States, Brazil, Italy, Australia, India, Turkey, Russian Federation, Spain, Indonesia, Hungary, South Africa, Germany, Mexico, Argentina, Singapore, Saudi Arabia, Colombia, Czech Republic, Canada, France, Croatia,Thailand, Bulgaria, Slovenia, Hong Kong, Poland, Sri Lanka, Chile, Japan, Austria, Ukraine, Azerbaijan, Ireland, Tunisia, Greece, Taiwan, Egypt, Bolivia, Paraguay, Iran, Islamic Republic , Morocco, Angola, Belgium, Portugal, Norway, Venezuela, United Arab Emirates, Algeria, Korea, Republic Of, Slovakia, Georgia, Lebanon, Macedonia, Sweden, Philippines, Vietnam, Dominican Republic