Some Kylix problems for
newer Linux Kernels resolved

Error: "Operation not allowed on a unidirectional dataset"
Error : “Undefined symbol: initPAnsiStrings”
Kylix halts when trying to run program

Having installed a Kylix 3 on a Linus Red Hat 9 system, I have had quite a headache since.
A lot of advices can be found - some works (partially), some doesn't (really).


Problem 1: Kylix halts when trying to run an application.

Just put this line:
export LD_ASSUME_KERNEL=2.2.5
just after the line
#!/bin/bash
in startdelphi (you may have it in home/[username]/kylix3 if you installed as username or in /usr/local/bin if you installed as root.

Why 2.2.5? Tell me!


Problem 2: Program won't run as stand-alone: Error : ”undefined symbol: initPAnsiStrings”

Ruddy on http://forums.belution.com/en/kylix/000/000/25s.shtml says:

... try this
http://www.efg2.com/Lab/Library/Kylix/deployment.htm

> 1. edit: /etc/ld.so.conf
> 2. add line to <src>/kylix3/bin - example: /usr/local/kylix3/bin
> 3. save, exit
> 4. ldconfig
> it should run fine now.

And it does!


Problem 3: Operation now allowed on unidirectional dataset when using MysSql (dbExpress)

You seem to be unable to use interesting components like the dbGrid, and even worse, you seem to be unable to write to a database at all.
The trick is to "buffer" data in a in between in a ClientDataSet /DatasetProvider combination. Anyway, you will get the idea by looking at the source of a form that actually runs below.
You will also have to apply your updates, since the way ClientDataSet's buffer (making the dataset bidirectional) but it is your responsibility to write out the buffer. A solution is - in the following example ヨ to apply updates when the data are edited, like

  procedure TForm1.ClientDataSet1BeforeScroll(DataSet: TDataSet);
  Begin
    ApplyUpdates
  End;

  procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
  begin
    ApplyUpdates
  end;

  procedure TForm1.ApplyUpdates;
  Var
    ErrCount : Integer;
  begin
    ClientDataSet1.ApplyUpdates(-1);
    If ClientDataSet1.Modified Then
      DatasetProvider1.ApplyUpdates(ClientDataset1.Delta,-1,ErrCount);
  end;

In the following, some things have to be changed on you specific configuration, for instance, I am using a table called person in a database called test with the fields fornavn, efternavn, adresse and alder etc.

In the unit you have a form defined as:

  TForm1 = class(TForm)
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBEdit3: TDBEdit;
    DBEdit4: TDBEdit;
    DBNavigator1: TDBNavigator;
    DataSource1: TDataSource;
    SQLTable1: TSQLTable;
    DataSetProvider1: TDataSetProvider;
    ClientDataSet1: TClientDataSet;
    SQLConnection1: TSQLConnection;
    procedure ClientDataSet1BeforeScroll(DataSet: TDataSet);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    procedure ApplyUpdates;
end;

And this is the corresponding .xfm-file:

object Form1: TForm1
    Left = 194
    Top = 130
    Width = 385
    Height = 358
    HorzScrollBar.Range = 289
    VertScrollBar.Range = 267
    ActiveControl = DBEdit1
    Caption = 'Form1'
    Color = clBackground
    PixelsPerInch = 84
    TextHeight = 18
    TextWidth = 5

object DBEdit1: TDBEdit
    Left = 101
    Top = 88
    Width = 188
    Height = 26
    DataField = 'fornavn'
    DataSource = DataSource1
    MaxLength = 30
    TabOrder = 0
end

object DBEdit2: TDBEdit
    Left = 101
    Top = 128
    Width = 188
    Height = 26
    DataField = 'efternavn'
    DataSource = DataSource1
    MaxLength = 30
    TabOrder = 1
end

object DBEdit3: TDBEdit
    Left = 101
    Top = 168
    Width = 188
    Height = 26
    DataField = 'adresse'
    DataSource = DataSource1
    MaxLength = 50
    TabOrder = 2
end

object DBEdit4: TDBEdit
    Left = 101
    Top = 208
    Width = 188
    Height = 26
    DataField = 'alder'
    DataSource = DataSource1
    TabOrder = 3
end

object DBNavigator1: TDBNavigator
    Left = 48
    Top = 240
    Width = 240
    Height = 27
    DataSource = DataSource1
    TabOrder = 4
end

object DataSource1: TDataSource
    DataSet = ClientDataSet1
    Left = 120
    Top = 16
end

object SQLTable1: TSQLTable
    SQLConnection = SQLConnection1
    IndexFieldNames = 'alder'
    TableName = 'person'
    Left = 72
    Top = 16
end

object DataSetProvider1: TDataSetProvider
    DataSet = SQLTable1
    Constraints = True
    Left = 48
    Top = 48
end

object ClientDataSet1: TClientDataSet
    Active = True
    Aggregates = <>
    Params = <>
    ProviderName = 'DataSetProvider1'
    Left = 96
    Top = 48
end

object SQLConnection1: TSQLConnection
    Connected = True
    ConnectionName = 'MySQLConnection'
    DriverName = 'MySQL'
    GetDriverFunc = 'getSQLDriverMYSQL'
    LibraryName = 'libsqlmy.so'
    LoginPrompt = False
    Params.Strings = (
    'DriverName=MySQL'
    'HostName=alleen'
    'Database=test'
    'User_Name=root'
    'Password=****'
    'BlobSize=-1'
    'ErrorResourceFile=./DbxMySqlErr.msg'
    'LocaleCode=0000')
    VendorLib = 'libmysqlclient.so.10'
    Left = 24
    Top = 16
end

end