Configuring FireDac for cross platform development using Firebird 2.5 - macos

I am creating a cross platform data aware app for windows and os x using Delphi 10.1 Berlin and firebird. My Mac is running El Capitan. My PC is running in Parallels virtual machine on the Mac.
The app on each platform is to connect to a firebird 2.5 server located on a Win 2008 server. The win32 version compiles and connects without a problem. The one for OS X, however, does not.
I have already downloaded and installed FB 2.5 on my Mac and set up PAserver properly. For example, I have been able to connect to firebird on the Windows server from my Mac using RazorSQL. I have also been able to compile a very simple "Hello world" project with just a button and a ShowMessage dialog and run it on the Mac. So, I am sure PAserver is running correctly.
I created a barebones data aware application for testing. Here is the form in text format:
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 480
ClientWidth = 640
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
DesignerMasterStyle = 0
object StringGrid1: TStringGrid
Align = Client
CanFocus = True
ClipChildren = True
Size.Width = 640.000000000000000000
Size.Height = 440.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
RowCount = 0
Viewport.Width = 636.000000000000000000
Viewport.Height = 415.000000000000000000
end
object ToolBar1: TToolBar
Size.Width = 640.000000000000000000
Size.Height = 40.000000000000000000
Size.PlatformDefault = False
TabOrder = 7
object NavigatorBindSourceDB1: TBindNavigator
Position.X = 176.000000000000000000
Position.Y = 7.000000000000000000
Size.Width = 241.000000000000000000
Size.Height = 25.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
DataSource = BindSourceDB1
xRadius = 4.000000000000000000
yRadius = 4.000000000000000000
end
end
object FDConnection1: TFDConnection
Params.Strings = (
'Database=E:\Shared Folders\Employees\Firebird\Databases\Test.fdb'
'User_Name=SYSDBA'
'Password= (intentionally deleted)'
'Protocol=TCPIP'
'Server=afmsasrv'
'Port=3024'
'ExtendedMetadata=True'
'CharacterSet=win1252'
'DriverID=FB25')
Connected = True
LoginPrompt = False
Left = 440
Top = 112
end
object FDGUIxWaitCursor1: TFDGUIxWaitCursor
Provider = 'FMX'
Left = 344
Top = 120
end
object FDTable1: TFDTable
Active = True
IndexFieldNames = 'ID'
Connection = FDConnection1
UpdateOptions.UpdateTableName = 'PERSON'
TableName = 'PERSON'
Left = 272
Top = 128
end
object DataSource1: TDataSource
DataSet = FDTable1
Left = 216
Top = 128
end
object BindSourceDB1: TBindSourceDB
DataSet = FDTable1
ScopeMappings = <>
Left = 304
Top = 224
end
object BindingsList1: TBindingsList
Methods = <>
OutputConverters = <>
Left = 20
Top = 5
object LinkGridToDataSourceBindSourceDB1: TLinkGridToDataSource
Category = 'Quick Bindings'
DataSource = BindSourceDB1
GridControl = StringGrid1
Columns = <>
end
end
end
When I run the project I get the error below:
[FireDAC][Phys]-300. Driver [FB25] is not registered. Correct driver ID or define [FB25] virtual driver in FDDrivers.ini'. Process Project1 (1114)
I have added FDDrivers.ini to my project, as indicated in Embarcadero's FireDac documentation. Here are the contents.
[FDDrivers.ini]
Encoding=UTF8
[FB25]
; FB25 virtual driver will use specified Firebird client library
BaseDriverID=FB
VendorLibWin32=C:\firebird\fb25_W32\bin\fbclient.dll
VendorLibWin64=C:\firebird\fb25_64\bin\fbclient.dll
VendorLibOSX32=/Library/Frameworks/Firebird.framework/Libraries/Versions/A/libfbclient.dylib
Any ideas on how to get this to work?

Related

How to change the color of the dot inside a radio button with Resource Hacker

I’m trying to modify the color of the dot inside a radio button with Resource Hacker. I managed to change the color of the circle/frame but not the dot inside. I looked everywhere online and found similar examples but doesn’t exactly suit me with my situation. I guess all I need is the right syntax format. I tried so many different code combinations to no avail since I’m a newbie in coding. I’d really appreciate if you could help me out. The exact code I’m fiddling is below. Many thanks in advance.
object ScanCandidateGrp: TRzRadioGroup
Left = 103
Top = 34
Width = 64
Height = 66
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
Font.Style = []
TextShadowColor = clActiveBorder
GroupStyle = gsCustom
ItemFrameColor = clRed << I managed to change the circle color with this
ItemHotTrack = True
ItemHighlightColor = clBlue
ItemHotTrackColor = clGreen
ItemIndex = 0
Items.Strings = (
'Bob'
'Alex'
'Sue')
ParentFont = False
StartXPos = 2
StartYPos = 0
TabOrder = 0
Transparent = True
VerticalSpacing = 5
OnClick = ScanCandidateGrpClick
end

VB6 upon loading converts adodc to pictureBox

Setup windows 10 running and compiling vb6 for our product.
Haven't had issues until recently and my handling of git caused some errors so I had to reload things in from our original copy on another machine.
The issue lies within the form section of my project and I have finally discovered what is causing the issue.
The original issue was though I had the proper components and references loaded in and i could see it in my object browser it failed to use it and gave me the error: method or data member not found
After tons of searching I found out the it was converting
what was suppose to be an adodc into a picture box
Height = 375
Left = -63480
Top = 480
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 240
CommandTimeout = 240
CursorType = 2
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"frmDP.frx":0EAA
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
However when you open up the project it labels this as well as at least I've found ```TrueOleDBGrid80.TDBGrid````
to also be labeled and properties set as a pictureBox
I've verified i have the libraries on my machine and are registered.
I've made sure the components and references that are required to use these are also choosen and applied
Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#..\..\..\..\Windows\SysWow64\msstdfmt.dll#Microsoft Data Formatting Object Library 6.0 (SP4)
Reference=*\G{00000206-0000-0010-8000-00AA006D2EA4}#2.6#0#..\..\..\..\Program Files (x86)\Common Files\System\ado\msado26.tlb#Microsoft ActiveX Data Objects 2.6 Library
Reference=*\G{3D5C6BF0-69A3-11D0-B393-00A0C9055D8E}#1.0#0#..\..\..\..\Program Files (x86)\Common Files\designer\msderun.dll#Microsoft Data Environment Instance 1.0 (SP4)
Reference=*\G{420B2830-E718-11CF-893D-00A0C9054228}#1.0#0#..\..\..\..\Windows\SysWOW64\scrrun.dll#Microsoft Scripting Runtime
Reference=*\G{00025E01-0000-0000-C000-000000000046}#5.0#0#..\..\..\..\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll#Microsoft DAO 3.6 Object Library
Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; mscomctl.ocx
Object={67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0; MSADODC.OCX
Object={CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0; msdatgrd.ocx
Object={C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0; msmask32.ocx
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; ComDlg32.ocx
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0; richtx32.ocx
Object={248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0; mswinsck.ocx
Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; mscomct2.ocx
Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.ocx
Object={E7BC34A0-BA86-11CF-84B1-CBC2DA68BF6C}#1.0#0; ntsvc.ocx
Object={562E3E04-2C31-4ECE-83F4-4017EEE51D40}#8.0#0; todg8.ocx
I can manually recreate it though I did not make this myself and more so was put into this section and have had to dig a lot to understand a lot of these things.
The answer i am trying to find is why aren't these being created the way theyre coded to be created.
Or how can i convert these over and have vb6 fix it itself/

C++ Builder 10.4, FMX: Form TabOrder problem

The Tab functionality to switch between control fields seems to be not working with C++ Builder 10.4 (with patch 1, 2 and 3), if a form control which contains some taborder fields, gets another parent form control programmaticly.
This can be reproduced very easily by creating a Multi-Device Application, with just 2 TLayout-controls and 2 TEdit-controls on a form:
Steps to reproduce:
Create a new Multi-Device Application, Blank Application. This will create a Unit1 with a blank form.
For the generated Unit1, just drop a TLayout from the Palette to the form and resize this to match almost the left half of the form.
Drop a second TLayout control on the form (Layout2) and resize this layout to match the right half of the form.
Drop 2 TEdit control fields on Layout1 (Edit1 and Edit2).
For Layout1, set the TabOrder property to 0, and make sure the property TabStop is set to True.
For Layout2, set the TabOrder property to 1, and make sure the property TabStop is set to True.
For Edit1, set the TabOrder property to 0, make sure the property TabStop is set to True, and set text to "edit1".
For Edit2, set the TabOrder property to 1, make sure the property TabStop is set to True, and set text to "edit2".
Build and run the project: The form with 2 edit fields appears and with Tab you can switch between the fields. This is OK! If the value of the Layout1 property TabOrder is kept to be -1, the Tab is also working, but only after selecting 1 of the edit fields with a mouse-click.
Now, in the constructor of TForm1 program Layout2 as the parent of Layout1:
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Layout1->Parent = Layout2;
}
Build and run the project again. The position of the edit fields on the form is now changed to the right as expected. But there the Tab functionality is gone!
Why? If the same steps are executed in C++ Builder 10.2, the Tab functionality keeps working after setting the parent of Layout1 to Layout2.
Content of Unit1.fmx, as requested by "Schneider Infosystems Ltd":
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 480
ClientWidth = 640
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
OnShow = FormShow
DesignerMasterStyle = 0
object Layout1: TLayout
Position.X = 8.000000000000000000
Position.Y = 8.000000000000000000
Size.Width = 305.000000000000000000
Size.Height = 409.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
object Edit1: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
TabOrder = 0
Text = 'edit1'
Position.X = 64.000000000000000000
Position.Y = 72.000000000000000000
end
object Edit2: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
TabOrder = 1
Text = 'edit2'
Position.X = 64.000000000000000000
Position.Y = 112.000000000000000000
end
end
object Layout2: TLayout
Position.X = 328.000000000000000000
Position.Y = 8.000000000000000000
Size.Width = 305.000000000000000000
Size.Height = 409.000000000000000000
Size.PlatformDefault = False
TabOrder = 1
end
end
Yes!
It works after installing "C++ Builder 10.4.1" !
So, it was a bug in 10.4.
I have to do a lot more actions to build and test all existing software I care about, but I am happy that the TAB-key functionallity seems to be solved! :)
I had to do a complete deïnstall and install of RadStudio. Also third party software has to be integrated again in the IDE. A lot of work. I keep wondering why this was necessary, and could not be solved with patch updates with "GetIt" in version 10.4.

Win7: Set Custom Text Size changes position of button's image

Good day all! I have a very tricky for me question.
In my application I have button with image inside. All properties of this button:
Me.cmdSelectAll.BackColor = System.Drawing.SystemColors.Control
Me.cmdSelectAll.Image = CType(resources.GetObject("cmdSelectAll.BackgroundImage"), System.Drawing.Image)
Me.cmdSelectAll.ImageAlign = Drawing.ContentAlignment.BottomRight
Me.cmdSelectAll.Cursor = System.Windows.Forms.Cursors.Default
Me.cmdSelectAll.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cmdSelectAll.ForeColor = System.Drawing.SystemColors.ControlText
Me.cmdSelectAll.Location = New System.Drawing.Point(0, 282)
Me.cmdSelectAll.Name = "cmdSelectAll"
Me.cmdSelectAll.Padding = New System.Windows.Forms.Padding(0, 0, 0, 0)
Me.cmdSelectAll.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.cmdSelectAll.Size = New System.Drawing.Size(22, 22)
Me.cmdSelectAll.TabIndex = 11
Me.cmdSelectAll.TabStop = False
Me.ToolTip1.SetToolTip(Me.cmdSelectAll, "Select All Channels")
Me.cmdSelectAll.UseVisualStyleBackColor = False
When I run it with default text size of win7, the image appears in the center, it's all ok. But when I set some custom value of text size (115%) my image suddenly goes more right and down. It occurs with all of my button's images. Could you please answer me why does this happen and how can i fix this issue? Thanks

Delphi 2009 label problems in Windows7

i'm developing am aplication in delphi 2009.
in windows xp, this code works fine
X := 70;
Label1.Caption :=FloatToStr(X)+' %'; /// (70 %)
In Windows 7, same code generates a diferent label (% 70), the position of characters are changing, all operators are going to front.
Just so that the question has a coherent answer for any future visitors, the issue is the BiDiMode. The following screenshot shows a reproduction of the behaviour described in the question.
This was generated with the following DFM file.
object MyForm: TMyForm
object Label1: TLabel
Left = 8
Top = 8
Width = 23
Height = 13
BiDiMode = bdLeftToRight
Caption = '70 %'
ParentBiDiMode = False
end
object Label2: TLabel
Left = 5
Top = 24
Width = 23
Height = 13
BiDiMode = bdRightToLeft
Caption = '70 %'
ParentBiDiMode = False
end
end

Resources