I am have also having problem accessing innodb tables with MyDAC 5.20.0.13, it seems the library did not find the innodb tables, even with new patch created / sent by Dimon / Dmitry Gerasimenko. The patch itself works well with MyISAM tables.
Dmitry said I have to include parameter --innodb in the TMyEmbConnection.Params, as he suggested, I've added it. But it did not work well in my code. It still did not find the innodb tables.
So here my code in case you want to look at, maybe I missed something.
the pas file
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, DB, MemDS, DBAccess, MyAccess, MyEmbConnection,
StdCtrls;
type
TForm1 = class(TForm)
MyEmbConnection1: TMyEmbConnection;
MyQuery1: TMyQuery;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Edit1: TEdit;
Button1: TButton;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
MyQuery1.Close;
MyEmbConnection1.Close;
MyEmbConnection1.BaseDir := ExtractFilePath(Application.ExeName);
MyEmbConnection1.DataDir := MyEmbConnection1.BaseDir + 'Data';
MyEmbConnection1.Database := Edit1.Text;
MyEmbConnection1.Open;
MyQuery1.SQL.LoadFromFile('sql.sql');
MyQuery1.Open;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
MyQuery1.Close;
MyEmbConnection1.Close;
end;
end.
the dfm
Code: Select all
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 290
ClientWidth = 465
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
DesignSize = (
465
290)
PixelsPerInch = 96
TextHeight = 13
object DBGrid1: TDBGrid
Left = 8
Top = 32
Width = 449
Height = 250
Anchors = [akLeft, akTop, akRight, akBottom]
DataSource = DataSource1
TabOrder = 0
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'Tahoma'
TitleFont.Style = []
end
object Edit1: TEdit
Left = 8
Top = 5
Width = 121
Height = 21
TabOrder = 1
Text = 'Edit1'
end
object Button1: TButton
Left = 135
Top = 1
Width = 90
Height = 25
Caption = 'Button1'
TabOrder = 2
OnClick = Button1Click
end
object MyEmbConnection1: TMyEmbConnection
Database = 'mysql'
Params.Strings = (
'--datadir=data'
'--innodb')
Username = 'root'
Password = ''
LoginPrompt = False
Left = 24
Top = 16
end
object MyQuery1: TMyQuery
Connection = MyEmbConnection1
Left = 64
Top = 16
end
object DataSource1: TDataSource
DataSet = MyQuery1
Left = 104
Top = 16
end
end
Thanks in advance.