Assertion failure

Assertion failure

Postby FullTechnologies » Tue 04 Oct 2005 09:45

I'm using a MyQuery to get some data from one table.
This table have integer, string and blob field.

When i open my frame, i open the MyQuery and i have this error :

Assertion failure (d:\projects\delphi\mydac\source\MySqlnet.pas, ligne 575)

The drive D is my Dvd-Writer :roll:

Thank for fix this.
FullTechnologies
 
Posts: 3
Joined: Tue 04 Oct 2005 09:41

Postby Ikar » Tue 04 Oct 2005 09:47

We couldn't reproduce the problem.
Please send us (mydac*crlab*com) a complete small sample to demonstrate it and include script to create and fill table.

Also supply us following information

- Exact version of Delphi, C++ Builder or Kylix
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client.
You can see it in Info sheet of TMyConnection Editor
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby Guest » Tue 04 Oct 2005 12:22

Delphi 2005 update 3
MySQL Data Access Components Standard version 3.55.0.23 (02.08.05)
MySQL 4.1.11

Table script :

CREATE TABLE partenaires (
Id int(11) NOT NULL auto_increment,
NomPartenaire varchar(50) NOT NULL default '',
UrlSite varchar(255) NOT NULL default '',
Logo longblob NOT NULL,
Descriptif longtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


My code :


Code: Select all
unit PartenaireForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,jpeg, Grids, DBGrids, SMDBGrid, DB, MemDS, DBAccess, MyAccess,
  ComCtrls, ToolWin, StdCtrls, DBCtrls, Mask, ExtCtrls, JvComponent, JvBaseDlg,
  JvImageDlg;

type
  TfrmPartenaire = class(TFrame)
    DataSource1: TDataSource;
    Panel1: TPanel;
    Panel2: TPanel;
    SMDBGrid1: TSMDBGrid;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBImage1: TDBImage;
    DBMemo1: TDBMemo;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    tbAdd: TToolButton;
    tbLoad: TToolButton;
    toolbutton9: TToolButton;
    tbPost: TToolButton;
    tbCancel: TToolButton;
    tbDel: TToolButton;
    ToolButton8: TToolButton;
    tbModif: TToolButton;
    OpenDialog1: TOpenDialog;
    Image1: TImage;
    MyTable1: TMyQuery;
    procedure tbLoadClick(Sender: TObject);
    procedure tbCancelClick(Sender: TObject);
    procedure tbPostClick(Sender: TObject);
    procedure tbDelClick(Sender: TObject);
    procedure tbModifClick(Sender: TObject);
    procedure tbAddClick(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
    constructor Create (Owner : TComponent);override;
    destructor Destroy;override;
    procedure ActiveBouton;
    procedure DesactiveBouton;
  end;

implementation

uses Moduledonnees, MainForm;

{$R *.dfm}

procedure TfrmPartenaire.tbAddClick(Sender: TObject);
begin
  MyTable1.Append;
  ActiveBouton;
end;

procedure TfrmPartenaire.tbModifClick(Sender: TObject);
begin
  MyTable1.Edit;
  ActiveBouton;
end;

procedure TfrmPartenaire.tbDelClick(Sender: TObject);
begin
  if MessageDlg('Etes vous sûr de vouloir supprimer ce partenaire ?',mtConfirmation,[mbYes,mbNo],0) = mrYes then
    Mytable1.Delete;
end;

procedure TfrmPartenaire.tbPostClick(Sender: TObject);
begin
MyTable1.Post;
DesactiveBouton;
end;

procedure TfrmPartenaire.tbCancelClick(Sender: TObject);
begin
MyTable1.Cancel;
DesactiveBouton;
end;

procedure TfrmPartenaire.tbLoadClick(Sender: TObject);
begin
  if OpenDialog1.Execute then
  begin
    Image1.Picture.LoadFromFile(OpenDialog1.FileName);
    MyTable1.FieldByName('Logo').Assign(Image1.Picture.Bitmap);
  end;
end;

constructor TfrmPartenaire.Create(Owner: TComponent);
begin
  inherited Create(owner);
  MyTable1.Open;
end;

destructor TfrmPartenaire.Destroy;
begin
  MyTable1.Close;
  inherited;
end;

procedure TfrmPartenaire.ActiveBouton;
begin
  tbPost.Visible := True;
  tbCancel.Visible := True;
  DBEdit1.Enabled := True;
  DBEdit2.Enabled := True;
  DBImage1.Enabled := True;
  DBMemo1.Enabled := true;
  DBEdit1.Color := clWhite;
  DBEdit2.Color := clWhite;
  DBMemo1.Color := clWhite;

  tbAdd.Enabled := False;
  tbModif.Enabled := False;
  tbDel.Enabled := False;
  tbLoad.Enabled := True;
end;

procedure TfrmPartenaire.DesactiveBouton;
begin
  tbPost.Visible := False;
  tbCancel.Visible := False;
  DBEdit1.Enabled := False;
  DBEdit2.Enabled := False;
  DBImage1.Enabled := False;
  DBMemo1.Enabled := False;
  DBEdit1.Color := clSilver;
  DBEdit2.Color := clSilver;
  DBMemo1.Color := clSilver;

  tbAdd.Enabled := True;
  tbModif.Enabled := True;
  tbDel.Enabled := True;
  tbLoad.Enabled := False;

end;

end.


I test with MyTable and MyQuery, and i have the same failure.
I have parametred the MyQuery in this way :

Fetchall = true
Options :
QuotedName = True

The MyConnection is in a Datamodule "form" (Moduledonnees)

You can exchange smdbgrid with a standard dbgrid and all jv components by the standard. (i have no possibilities to give you a source code, because i have no ftp to upload it).

I use this system in others frames and i have no problem. Can the blob field be the problem ?
Guest
 

Postby FullTechnologies » Tue 04 Oct 2005 12:26

Sorry, i forgot to connect me on the forum ^^

The error message be showed when i Open the table/Query
FullTechnologies
 
Posts: 3
Joined: Tue 04 Oct 2005 09:41

Postby swierzbicki » Tue 04 Oct 2005 14:39

Salut FullTechnologies :)

Have you simply debug your application ?
Where does the "Assertion Failure" raised ? ; just do some step by step into your source code.

IF you still don't find the problem :

Create a simple project under D2005
Extract into a text file all SQL Statement needed to run your project, FYI most of MySQL Database adminstration tools make this possible.

Rar all of this (don't include EXE + DCU + ~* files). Send it to the support.
If you don't know how to get through, just mail me (in french if you want to)
swierzbicki
 
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Postby FullTechnologies » Wed 05 Oct 2005 07:24

After many test and a test application ... i found the problem.

in the test application the MyConnection have the option compress to false, but in my standard application the option is true.

In the IDE, when i active my table/query (only in this table), i have the same error message, if Compress option is true.
FullTechnologies
 
Posts: 3
Joined: Tue 04 Oct 2005 09:41

Postby swierzbicki » Wed 05 Oct 2005 09:27

all right !!! that's somehow understable !
swierzbicki
 
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Postby Ikar » Thu 06 Oct 2005 09:13

Please send us (mydac*cralb*com) complete small sample to reproduce problem. It is obligatory to include script to create and fill table.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components