Noutați

Build High-Speed Direct Access Apps In Delphi And C++Builder To Most Modern Databases Using FireDAC

FireDAC is a unique set of Universal Data Access Components for developing multi-device database applications for Delphi and C++Builder. With its powerful common architecture, FireDAC enables native high-speed direct access from Delphi to InterBase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, IBM DB2, SQL Anywhere, Access, Firebird, Informix and more. Large collection of advanced capabilities. Key things to know about FireDAC listed in this post. Configuration Options: Highly configurable, using this you can fine tune your data access and it is important how your Software access with databases. FireDAC provides a wide range of options organized into a hierarchical options system. Most of the options may be left with their default values.The FireDAC options are organized into five groups: FetchOptions – Fetch options that control how the components and Phys layer commands fetch data from a DBMS. For example, it is possible to fetch all records at once or fetch records on demand. FormatOptions – Format options that control how the DBMS data types are mapped to the FireDAC data types and backward. For example, a programmer may set up a mapping for Oracle NUMBER (38) onto dtBCD or onto dtInt64. For more details, read Data Type Mapping. UpdateOptions – Update options that control how FireDAC posts updates to DBMS. For example, during an update, FireDAC can update all fields in a table or only the changed ones. ResourceOptions – Resource options that control how system resources are used, dataset persistence and other. For example, a FireDAC Phys layer command can be performed asynchronously or blocked. TxOptions – Transaction options that control how transactions are performed. For example, perform them in a ReadCommitted isolation mode. Note that TxOptions does not use option value inheritance. SQL Command Preprocessor: The SQL command preprocessor can alter your SQL before sending it to the server When ResourceOptions.EscapeExpand and ResourceOptions.MacroExpand are true. It supports macros substitution and escape sequences.FireDAC supports three types of macro instructions: Substitution variables. A substitution variable starts with the ‘!’ or ‘&’ symbol and is followed by the macro variable name.They allow placing substitution parameters in a command text in order to extend the use of parameters. For example, to parameterize a table name in the FROM clause or the column names in the SELECT clause, you can use substitution variables but not parameters. Escape sequences. They allow writing DBMS-independent SQL commands. Conditional substitutions. They allow expanding the SQL command conditionally, depending on application-defined attributes or on the currently attached DBMS. FireDAC has 4 types of escape sequences: It is enclosed in curly braces ({}). Allowing constant substitution: Allow writing constants in command text, independent of the DBMS syntax and regional settings. Allowing identifier substitution. Alows abstracting from DBMS-specific identifier quoting rules.  Conditional substitution: Allow to substitute text into command, depending on either a DBMS the application is connected to, or on a macro variable value. Beside different syntaxes, these constructions handle parameters and macros in different ways. Scalar functions.Allows abstracting from a DBMS-specific set of a built-in functions and their syntax.  For examples check here Array DML : The Array DML execution technique submits a single DBMS command with an array of parameters. Each command parameter has an array of values, and all parameters have arrays of the same length. Then FireDAC requests the DBMS to execute a command once for each row in arrays. This technique reduces the amount of communication between DBMS […]

Read More

Optimize Database Population Performance With Array DML In Delphi

This sample demonstrates how to use Array DML in FireDAC and compares its performance for different array sizes. Location You can find the ArrayDML sample project at: Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to: Object PascalDatabaseFireDACSamplesComp LayerTFDQueryExecSQLArrayDML Subversion Repository: You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version. How to Use the Sample Navigate to the location given above and open FireDACArrayDML.dproj. Press F9 or choose Run > Run. Files File in Delphi Contains FireDACArrayDML.dprojFireDACArrayDML.dpr The project itself. fMain.pasfMain.fmx The main form. Implementation Instead of configuring the main components of this sample at design time using the Object Inspector, this sample configures the setup of the TFDConnection and the TFDQuery in run time. When you run the application, you see the following components on the form: A memo object. Two edit objects named DML ArraySize and No of Records. The default value of both objects is 100 and 100000, respectively. A check box object labeled as Use Transactions. It is unchecked by default. Three buttons objects labeled as Run Single Test, Run Array Size Test, and Delete all Rows. Once the sample is running, you can interact with the sample by changing the edit boxes or clicking on the aforementioned buttons: Click on the Run Single Test button to run an Array DML test code using the Execute method in Array DML mode. To this end, the sample takes the length of the DML array from the value of the DML ArraySize edit object. Using the default values of the edit boxes, the sample runs the test for 100000 records using chunks, where each chunk is a DML array of length 100. This mean that for each DML array, the test executes 100 SQL INSERT commands in a single step in order to optimize database population performance. Moreover, as it is done for 100000 records, the sample uses 1000 DML arrays. To implement the test, the sample configures the following: The connection is set to an Oracle demo database.Note: Change the connection parameters according to your environment. For further details, see Database Connectivity (FireDAC). The INSERT command is the following: ‘insert into {id FDQA_Batch_test}(tint, tstring) values(:f1, :f2)’. If you check the Use Transactions check box, the sample uses: The StartTransaction method to start the database transaction before executing the INSERT command. The Commit method to permanently store the modifications made by the INSERT command execution. Click on the Run Array Size Test button to launch a loop that executes nine times the previous test. Each execution uses a different DML array length. The lengths are the following: 1, 2, 5, 10, 50,100, 500, 1000, 5000 and 10000. Click on the Delete all Rows button to delete all the records from the test table. To this end, the sample uses the ExecSQL method with the following DELETE command: ‘delete from {id FDQA_Batch_test}’. For more detailed information and external links to other articles, please follow the link below: http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.TFDQuery.ArrayDML_Sample

Read More

Learn How To Easily Customize The Appearance Of A ListView In This Delphi Sample App

Some of the use case needs to view the Multi Details Appearance for a List item in a ListView .e.g Selecting Multiple items Add or Delete from a List with Multi Detail information. Delphi/C++ Builder offers robust components to do the job at design time or runtime with less code and made developer life easy. ListViewMultiDetailAppearance Sample  show three detail text items. It does this by using list view item appearances previously defined in a custom package. You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version. Components used in ListViewMultiDetailAppearance App: TListView: FireMonkey component that you can use to hold and present various types of items. The ItemAppearance property value set to MultiDetailItem. TBindingsList: Built on the TCustomBindingsList component and publishes additional properties that can be accessed from within the Object Inspector. Add a new binding and select TLinkFillControlToField under Quick Bindings. TLinkFillControlToField: Links a control to a field and fills the control with possible values. TPrototypeBindSource: It can be used to generate sample data for the LiveBindings in your project. After you prototype an application, configure the real data source so that you see the new data source fields in the LiveBindings design. Implementation Details : When you run the application, it shows a list view. Each list item shows three different detail fields under their main label. You can tap the ToggleEditMode button to have the list view enter a selection edit mode where you can select several items. The buttons at the bottom, LiveBindings and Fill in Code, let you fill the list view with items defined using LiveBindings or defined at run time, respectively. Before Running this Sample ListViewMultiDetailAppearance need to install the package SampleListViewMultiDetailAppearancePackage.bpl. The package defines three subclasses of Appearances.TPresetItemObjects that implement a custom appearance for list view items. It actually defines a base subclass that is later inherited and extended by the other two subclasses. These subclasses use instances of Appearances.TTextObjectAppearance to implement the three detail fields that each list item shows. The rest of the fields are inherited from Appearances.TPresetItemObjects and customized as necessary. The ListViewMultiDetailAppearance application uses these subclasses in the ItemAppearance.ItemAppearance and ItemAppearance.ItemEditAppearance properties of the list view to use the appearance defined in the installed package. You can tap ToggleEditMode to see how the application keeps the appearance in edit mode.  Check out the full article in the DocWiki about the FMX.ListViewMultiDetailAppearance ListViewMultiDetailAppearance Sample App The LiveBindings button uses TLinkFillControlToField to fill the list view using LiveBindings. The Fill in Code button uses a for loop to fill the list view with items created at run time. Check out the full source code for the ListViewMultiDetailAppearance projects for Delphi and C++Builder over on GitHub.

Read More

Secrets Of FireDAC: Learn How To Use Macros In TFDQuery With This Delphi Sample

The Macros sample shows you how to use the Macros property of TFDQuery in order to parameterize parts of the SQL query. The sample allows you to modify the macro values at run time. Location You can find the Macros sample project at: Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to: Object PascalDatabaseFireDACSamplesComp LayerTFDQueryMacros Subversion Repository: You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version. How to Use the Sample Navigate to the location given above and open Macros.dproj. Press F9 or choose Run > Run. Click on the Use Connection Definition combo box and select an option. Interact with the sample: Modify the Macros values. Click on the Open Query button. Files File in Delphi Contains Macros.dprojMacros.dpr The project itself. fMacros.pasfMacros.fmx The main form. Implementation Before running the sample, the main components are configured at design time using the Object Inspector as follows: A TFDQuery object named qryMain. This component is used to implement a dataset capable of executing SQL queries. The following setup is needed: Configure the Connection property to specify the FireDAC connection object that is used to connect to a DBMS. Set the SQL property to select !column from !tab where !id !Sign !idValue. It specifies the SQL statement to execute for the query. On run time, when you click on the Open Query button, the Macro values are substituted in the place of their names in the SQL statement. Set up the macros property. The sample sets the five macros used on the SQL statement: COLUMN, TAB, ID, Sign, IDVALUE. Set the MacroCreate property of ResourceOptions to True. A TDataSource object named DataSource1. This component provides an interface between a dataset component and data-aware controls on a form. In this sample, it is used to provide communication between the dataset and the grid where the dataset is displayed. To this end, the DataSet property of DataSource1 is set to qryMain, and the DataSource property of DBGrid1 is set to DataSource1. When you run the application, click on the Use Connection Definition combo box and select an option in order to define a connection. When you select an item of the combo box, the sample enables the Open Query button. Then, if you click on the Open Query button, the sample uses the Open method of qryMain in order to execute the SQL statement. The SQL statement is executed using the Macros values in order to retrieve the corresponding data, which is displayed using a TDBGrid component. Once the DBGrid1 is filled, you can interact with the sample in run time: Modify the Macros values. Choose the corresponding Data Type. Click on the Open Query button Please follow the link below to get more information about the sample: http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.TFDQuery.Macros_Sample

Read More

Embarcadero Conference Brazil 2020

O maior evento Delphi do mundo irá acontecer novamente este ano. Mesmo com toda a situação da pandemia do COVID-19, a Embarcadero Conference 2020 irá se realizar no dia 20 de Outubro, em um novo formato, 100% online. Apesar dos participantes perderem algumas coisas que só acontecem em eventos presenciais, com conversas valiosas e trocas de experiências com outros participantes nos intervalos das sessões, haverá benefícios interessantes nesse novo formato: Taxa de inscrição mais acessível; Você pode participar de onde estiver – sem precisar pegar um avião e reservar um hotel; As palestras serão gravadas, assim os participantes não perderão nenhuma delas! Note que todas as palestras devem ser ao vivo. Assim, mesmo que elas sejam gravadas para serem vistas depois, escolhendo a palestra a participar trará os benefícios de poder interagir com o palestrante, fazer perguntas, conversar com os outros participantes, e assim por diante. Assim, aqui estão nossas sugestões para as palestras pra você participar: 9 am – SERVIÇOS NA NUVEM: NÃO COMETA ESTES ERROS! (Wagner Landgraf) Após anos lidando com desenvolvimento de serviços na nuvem, seja criando aplicações ou frameworks dedicados nessa área, o palestrante mostrará os principais conceitos, segredos, dicas e experiências para a construção de serviços na nuvem em Delphi. É um compartilhamento das experiências reais, problemas reais e sucessos reais, focando nas armadilhas e problemas que podem ocorrer ao longo do desenvolvimento e mostrando as soluções e prevenções para tais. 1 pm – SEU PRIMEIRO CRUD COM TMS WEB CORE (Marcos Moreira) Será mostrado como configurar o ambiente, criar sua primeira aplicação, e os aspectos para sua distribuição. 3:40 pm – TMS ACADEMIC – THE TMS SOFTWARE ACADEMIC PROGRAM (Wagner Landgraf) O programa TMS Academic será apresentado – suas motivações, seu futuro e como embarcar neste programa para obter licenças 100% gratuitas e funcionais dos produtos TMS se você for um aluno ou professor! Visite a página oficial da Embarcadero Conference 2020, registre-se e participe! — The biggest Delphi event in the world is coming again this year. Even with all the COVID-19 pandemic situation, Embarcadero Conference 2020 in Brazil will happen on October, 20th, in a new format, 100% online. Even though attendants will lose some things, like the great and valuable in-person conversations, there will be some great benefits with this format: More affordable fee; You can participate from where you are – no need to take a plane and book a hotel; Sessions will be recorded so attendants won’t miss any of them! Note that all sessions are supposed to be live. So even though they will be record, choosing a session to attend will bring you the benefit of interacting live with the speaker, asking questions, chatting with other attendants, and so on. Thus, here is our suggestions for sessions you could attend: 9 am – CLOUD SERVICES: DON’T MAKE THESE MISTAKES! (Wagner Landgraf) After years of dealing with cloud service development, whether creating applications or dedicated frameworks in this area, the speaker will show the main concepts, secrets, tips and experiences for building cloud services with Delphi. He will share real experiences, real problems and real successes, focusing on the pitfalls and problems that can occur throughout development and showing the solutions and preventions for them. 1 pm – YOUR FIRST CRUD WITH TMS WEBCORE (Marcos Moreira) You will […]

Read More

TMS WEB Core tips & tricks : Small sample with lots to learn about its versatility

In this article, we start from a TWebResponsiveGrid and use it to demonstrate various tricks that apply throughout the TMS WEB Core framework but are here in combination with the TWebResponsiveGrid perfect to show. The purpose of the article is to show how well the web HTML/CSS world blends with the Delphi developers components world and this in different & flexible ways. We will show you a couple of techniques to customize TWebResponsiveGrid items and make these interactive. TWebResponsiveGrid intro TWebResponsiveGrid is a responsive grid control. This means that it contains a number of items displayed in a 2D grid layout and this layout, i.e. number of columns will be controlled by the device screen size. This number of columns is determined by the setting TWebResponsiveGrid.Options.ItemMinWidth. This sets the minimum width of items in pixels. So, the grid will automatically show as much columns as allowed to still have this minimum width of items respected. And this also takes the TWebResponsiveGrid.Options.ItemGap in account that specifies the gap between items also in number of pixels. Other than this, there is not much to do. When the TWebResponsiveGrid is resized or displayed on a big or small screen, it will use these settings to automatically render the right number of columns for items. To see this directly live, you can also visit this online demo An item can be displayed in normal state, hover state and selected state. Therefore TWebResponsiveGrid.Options has settings for normal state, selected state and hover state colors. In addition or as alternative to setting colors (and other settings) for items, CSS can be used. TWebResponsiveGrid.Options.ItemClassName is the name of the CSS class that can be assigned to the item (outer HTML element of the item is a DIV). Beyond simple HTML in items The items one can add in a TWebResponsiveGrid are of the type TWebResponsiveGridItem and have a property HTML: string to set the HTML the item should contain and the generic Tag property. When the TWebResponsiveGrid.Options.ItemTemplate is set, this is preset for the item HTML when a new item is added. Note that when loading data from JSON or a dataset, the template can hold specifiers (%SPECIFIER%) and this is merged at runtime with hthe JSON attribute or dataset record field. The purpose of this article though is on programmatically filling the items collection. The initial code to fill the TWebResponsiveGrid as such is: for i := 0 to 20 do begin WebResponsiveGrid1.Items.Add.HTML := ‘Grid item ‘+i.ToString+’OK>/button>’; end; This shows how we have added some text and a button to a responsive grid item. The result is very simple. It does not look nice but the responsive behavior is there. The TWebResponsiveGrid is set to top aligned and when resizing the browser, the items automatically flow in the container. Before diving into making the HTML button react, let’s visually enhance the responsive grid items. We do this with some CSS for the TWebResponsiveGrid as well as the TWebResponsiveGridItem. While we could add the CSS style in the HTML file associated with the form or application (which is probably the best place), we wanted to take the opportunity here to introduce the TWebForm.AddCSS() method that allows to dynamically insert CSS at runtime (or remove it later and replace it). Doing so is simple as demonstrated with this […]

Read More

Comprehensive Music Theory and Ear Training App Built In Delphi

With almost 3,000 lessons created by music teachers for beginners to professional musicians playing any instrument, EarMaster is a comprehensive, consumer-grade app with extraordinary functionality that uses a variety of different technologies. Despite the app’s technologically advanced backend, the EarMaster team worked hard make it as simple and intuitive as possible to use. EarMaster features audio recording and audio playback, musical instrument digital interface (MIDI) input and output, instrument sound sampler and many other technologies – all made with the native iOS frameworks (AudioUnit, CoreMidi, etc). It supports Windows and macOS as well as iOS. It draws real-time pitch curves on a musical staff based on pitch detection of microphone recordings, teaching musicians of all levels to recognize, transcribe and sing melodies, scales, chords, intervals, chord progressions and rhythms. Website https://www.earmaster.com/ Press Release https://www.embarcadero.com/press-releases/embarcadero-selects-earmaster-for-august-cool-app-contest Screenshot Gallery “We choose Delphi because it allows us to create a true native iOS app, with a GUI using native components, and still share 97 percent of the source code with other platforms,” Hans Lavdal Jakobsen, managing director and lead developer of EarMaster ApS “If you develop a multi-platform app, Delphi is simply the fastest way to go.” Hans Lavdal Jakobsen, managing director and lead developer of EarMaster ApS

Read More

Quick Way To Bind Your Database To UI Components With BindLinkVCL Delphi Sample App

The BindLinkVCL Sample demonstrates the use of a TBindLink. In general, it is used for linking operations, for example, linking dataset fields to various lists. You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version. Components used in BindLinkVCL App: TBindingsList: Built on the TCustomBindingsList component and publishes additional properties that can be accessed from within the Object Inspector. Add a new binding and select TBindLink under Quick Bindings.  TBindLink : Built on the TCustomBindLink class and publishes a set of additional properties that can be accessed from within the Object Inspector. TBindingSourceDB:  Nonvisual component that provides a way to make data contained by the specified data source available to all components that want to access it, using LiveBindings. Along with these TDBNavigator, TDataSource,TClientDataset and other UI components such as TLabel, TEdit ,TImage were used. Implementation Details : Use the DBNavigator1 TDBNavigator to navigate through the dataset. TBindingsList is used to create managed binding among the different components. TBindLink is used to create bindings to the columns of the dataset. The ImageWithHander TImage displays the Graphic Field of the selected fish within the dataset. The EditWithHandler TEdit displays the Category Field of the selected fish within the dataset. The MaskEditWithHandler TMaskEdit displays the Category Field of the selected fish within the dataset. The ListBoxWithHandler TListBox displays the different Categories of the dataset. The MemoWithHandler TMemo displays the Notes Field of the selected fish. The LabelBind TLabel displays the Category, and Species Name of the selected fish. The LabelPosition TLabel displays the position of the selected fish within the dataset. The information these two TLabels display is defined in the Binding Expression Editor. The CheckBoxDatasetActive TCheckBox enables or disables the TDataSource.  Check out the full article in the DocWiki about the BindLinkVCL Sample. BindLinkVCL Sample App Check out the full source code for the BindLinkVCL projects for Delphi and C++Builder over on GitHub.

Read More

Ext JS 7.3.1 Patch Release is Available

October 21, 2020 | Kirti Joshi This week, we released a new Ext JS 7.3.1 software patch for our customers on maintenance. The release addresses 30+ customer reported tickets. You can find the full list in the 7.3.1 Release Notes and download 7.3.1 from the Sencha support portal. If you have any questions, email our support team at [email protected] Try Ext JS 7.3 Haven’t tried the latest version of Ext JS yet? The 30-day free trial is available via public npm or through an easy zip download. Get started and build your first app in 3 easy steps.

Read More

TMS FNC Maps updates!

Intro In April, we released the first version of TMS FNC Maps. Now 4.5 months later we have released v1.1 with exciting new features and improvements. TTMSFNCDirections: TravelMode tmPublicTransport, tmTruck added (for supported services) TTMSFNCDirections: GetDirections result Status and ErrorMessage added LoadGPXFromFile/LoadGPXFromStream/LoadGPXFromText now also supports elevation and timestamp data Events OnCreateGPXTrack, OnCreateGPXSegment for creating your own data structure when parsing GPX files TTMSFNCGoogleMaps: Clusters.Text property TTMSFNCGeoCoding: Get(Reverse)Geocoding result Status and ErrorMessage added Internally, a lot of smaller improvements have been made in combination with the existing supported services, TMS FNC Core and TTMSFNCWebBrowser. Edge Chromium Last week we also announced Edge Chromium Stable support for TAdvWebBrowser. We can now also announce that the TTMSFNCWebBrowser has been synchronized and offers Edge Chromium stable support. More details on how to install Edge Chromium can be found here. TMS FNC Maps Book TMS FNC Maps offers a demo and documentation to get you started, but if you really want to energize your developments the TMS FNC Maps Book is a must have! Stay tuned for more! TMS FNC Maps 1.2 is already around the corner with more exciting new features, so stay tuned and keep an eye on this blog .

Read More