compile error: 'Error constructing instance of abstract class 'MySqlConnection'

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
tgianmaria
Posts: 2
Joined: Wed 13 Jul 2005 16:15

compile error: 'Error constructing instance of abstract class 'MySqlConnection'

Post by tgianmaria » Wed 13 Jul 2005 17:00

Installed MySQL Direct .NET 2.80 Std (single developer license) successfully, MySQL Server 4.1 (local), Delphi 8 Update 3, Cassini WebServer.

Creating a new ASP.Net Web Application: able to add components to a webform (MySqlConnection, MySqlDataAdapter, DataSet) and to get them working at design time (connection to database, data retrieving).

Trying to compile a project (from a simple blank form with a single MySqlConnection component to a CoreLab MySql Direct Delphi sample project) stops the compiler at the line generated by the designer (procedure InitializeComponent):

Self.MySqlConnection1 := CoreLab.MySql.MySqlConnection.Create;

:shock: with the message "Error constructing instance of abstract class 'MySqlConnection'".

Any other MySQL Direct component does not generate this error message (for example Self.MySqlCommand1 := CoreLab.MySql.MySqlCommand.Create; for a MySqlCommand).

Thanks for helping.

Jim


unit WebForm1;

interface

uses
System.Collections, System.ComponentModel,
System.Data, System.Drawing, System.Web, System.Web.SessionState,
System.Web.UI, System.Web.UI.WebControls, System.Web.UI.HtmlControls,
CoreLab.MySql;

type
TWebForm1 = class(System.Web.UI.Page)
{$REGION 'Designer Managed Code'}
strict private
procedure InitializeComponent;
{$ENDREGION}
strict private
procedure Page_Load(sender: System.Object; e: System.EventArgs);
strict protected
MySqlConnection1: CoreLab.MySql.MySqlConnection;
procedure OnInit(e: EventArgs); override;
private
{ Private Declarations }
public
{ Public Declarations }
end;

implementation

{$REGION 'Designer Managed Code'}
///
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
///
procedure TWebForm1.InitializeComponent;
begin
Self.MySqlConnection1 := CoreLab.MySql.MySqlConnection.Create;
//
// MySqlConnection1
//
Self.MySqlConnection1.Name := 'MySqlConnection1';
Include(Self.Load, Self.Page_Load);
end;
{$ENDREGION}

procedure TWebForm1.Page_Load(sender: System.Object; e: System.EventArgs);
begin
// TODO: Put user code to initialize the page here
end;

procedure TWebForm1.OnInit(e: EventArgs);
begin
//
// Required for Designer support
//
InitializeComponent;
inherited OnInit(e);
end;


end.
Last edited by tgianmaria on Thu 14 Jul 2005 17:28, edited 2 times in total.

tgianmaria
Posts: 2
Joined: Wed 13 Jul 2005 16:15

Post by tgianmaria » Thu 14 Jul 2005 14:53

:D Version 3.00 works fine!

Post Reply