Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6725195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:46:43+00:00 2026-05-26T09:46:43+00:00

Okay, so my application was working just fine until I decided to clean up

  • 0

Okay, so my application was working just fine until I decided to clean up the design-time form a bit by creating a DataModule form and moving all database components to it. I’m using Delphi XE2 Update 1 and these components, TADOConnection, TADOTable, TADOQuery, TADOCommand. As soon as I tried to run the app for the first time with the above named components on the DataModule form, instead of the main form, it now returns an error when this line from the DPR is executed:

Application.CreateForm(TDataModule1, DataModule1);

The error raised is Class TADOCOnnection not found.. Now that I removed and re-added the TADOConnection to the DataModule form, it now raises a different error: Class TADOTable not found., but I think that is just because the create order has changed on the DataModule and a TADOTable is now the first object that is created on the form.

My uses clause from the DataModule is:

uses System.SysUtils, System.Classes, Data.Win.ADODB, Data.DB;

I read other posts that said to include ADODB and DB in the uses clause to overcome this error, but that doesn’t seem to help.

My full DPR file is:

program Project1;

uses
  Vcl.Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {DataModule1: TDataModule};

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TDataModule1, DataModule1);
  Application.Run;
end.

I even tried removing the line from the DPR file that creates the DataModule and doing that manually in the main form, but that just changes when I get the same error message(s).

I’m not sure what to try next, aside from moving all the components back to the main form. Don’t DataModule forms work the same in XE2 as prior versions of Delphi, and why aren’t the same TADOConnection and TADOTable class not found messages raised when the components are on the main form?

Any thoughts or insights are very much appreciated.

James

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:46:44+00:00Added an answer on May 26, 2026 at 9:46 am

    In creating a new project, which worked without any issues, I finally found the problem that I introduced into my own code.

    I had added a special method in the DataModules unit / class. I needed to pass an enumerated type as the parameter, so I created the enumeration in the scope of the class, like this:

    TDataModule1 = class(TDataModule)
    type
      TMyEnum = (eOne, eTwo, eThree);
    public
      ADOConnection1: TADOConnection;
      ... // more components added to the design window
      procedure MyMethod(const Param: TMyEnum);
    end;
    

    I added the enum to the class because it did not need to have global scope. Anyway… You’ll notice that I added the public scope identifier after the enum. That was my mistake. I assumed that components on a form are public, but that is wrong. They are published. Changing the scope identifier to published fixed the problem, because now the components are included in the RTTI, which is needed when a form is created at runtime.

    TDataModule1 = class(TDataModule)
    type
      TMyEnum = (eOne, eTwo, eThree);
    published // <- this fixes the "Class Not Found" at Runtime Error
      ADOConnection1: TADOConnection;
      ... // more components added to the design window
      procedure MyMethod(const Param: TMyEnum);
    end;
    

    Hope this helps someone else.

    James

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with an ExpandableListView in my application. It worked fine until I
Okay, here's my setup. I have a c# app working perfectly on all 32-bit
Okay I'll try to be direct. I am working on a file sharing application
Okay, so I'm moving my application over from non-SSL to SSL connections to my
I'm using WPF and MVVM in an application I'm working on. I was creating
Okay, I am working on an application and I want to store a file
Okay so I want to make an application that launches other applications. However, the
Okay still fighting with doing some SqlCacheDependecy in my Asp.net MVC application I got
Okay this is a real headscratcher. I have an application which calls a web
Okay, I have a WebBrowser control in my VB.NET application that loads a PHP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.