Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My Data Module keeps changing to a Form???

Status
Not open for further replies.

tjcusick

Programmer
Dec 26, 2006
134
US
I'm using Delphi 7.

I have been tasked with modifying an existing program. Basically I was told to take an existing data module make a new copy of it and modify the code to fit the new criteria, which I did and that part was easy. But what I found today was after I reloaded the project and tried to test it I get an error that says,
Project Renewal_Eval.exe raised exception class EReadError with message 'Property Color does not exist’. Process stopped. Use Step or Run to continue.
then i press [ok], then [f9] to continue then i get that the error is in
'Error reading dmcabopdata.color. Property color does not exist'.
and then it just continues press [ok] then [f9] (or [f8] or [f7])
The problem appears to be the fact that it is switching my Data Module to a Form... any suggestions as to why it would be doing this and how to stop it?

Thank you

Tom Cusick
 
Just to confirm: Did you change your Data Module to a Form or just make changes to the data module?
 
This is the RenewalData Code... Each Module is of class(TdmRenewalData)...

Code:
unit RenewalData;

interface

uses
  SysUtils, Classes;

type
  TdmRenewalData = class(TDataModule)
  private
    { Private declarations }
  public
    { Public declarations }
    procedure Evaluate(State: String; LOB : String; DaysAhead: Integer; var NumChecked, NumFlagged: Integer; var ActionLog: TStringList); virtual;
  end;

var
  dmRenewalData: TdmRenewalData;

implementation

{$R *.dfm}

{ TDataModule1 }

procedure TdmRenewalData.Evaluate(State: String; LOB : String; DaysAhead: Integer;
  var NumChecked, NumFlagged: Integer; var ActionLog: TStringList);
begin

end;

end.

This is the CABOPData Code that keeps changing to a form.

Code:
unit CABOPData;

interface

uses
  SysUtils, Classes, DB, MemDS, DBAccess, Ora, Windows, Shared, RenewalData, 
  DateUtils, DBClient, Provider, OraProvider, Math, strUtils;

type
  [B]TdmCABOPData = class(TdmRenewalData)[/b]
    qryBOPDetail: TOraQuery;...
  private
    { Private declarations }
  public
    { Public declarations }
    procedure Evaluate(State: String; LOB : String; DaysAhead: Integer; var NumChecked, NumFlagged: Integer; var ActionLog: TStringList); override;
  end;

var
  dmCABOPData: TdmCABOPData;

implementation

{$R *.dfm}

{TdmCABOPData}

Every other data module is setup exactly the same and none of them change to a form at all...

What i did was go to New and create a blank data module item. then i take the code that i wrote and paste it into the new data module. but once i save and close the project it rejects the data module as a data module and converts it to a form.

Even if i just change the type class defination line, save it, close and reopen it switches to a form...
Code:
unit TOMCAPOPData;

interface

uses
  SysUtils, Classes;

type
[b]  TDataModule1 = class(tdmrenewaldata)[/b]
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  DataModule1: TDataModule1;

implementation

{$R *.dfm}

end.

Maybe i'm just over looking something...

below are some of the other modules that have the same coding but have NOT changed to a form...
Code:
unit BOPData;

interface

uses
  SysUtils, Classes, DB, MemDS, DBAccess, Ora, Windows, Math, Shared, RenewalData;

type
  TdmBOPData = class(TdmRenewalData)
    qryBOPDetail: TOraQuery;...
  private
    { Private declarations }
  public
    procedure Evaluate(State: String; LOB : String; DaysAhead: Integer; var NumChecked, NumFlagged: Integer; var ActionLog: TStringList); override;
    { Public declarations }
  end;

var
  dmBOPData: TdmBOPData;

implementation

uses DateUtils;

{$R *.dfm}

{ TdmBOPData }
Code:
unit HOData;

interface

uses
  SysUtils, Classes, DB, MemDS, DBAccess, Ora, Windows, Shared,RenewalData;

type
  TdmHOData = class(TdmRenewalData)
    qryHODetail: TOraQuery;...
  private
    { Private declarations }
  public
    procedure Evaluate(State: String; LOB : String; DaysAhead: Integer; var NumChecked, NumFlagged: Integer; var ActionLog: TStringList); override;
    { Public declarations }
  end;

var
  dmHOData: TdmHOData;

implementation

{$R *.dfm}

{ TdmHOData }
 
Another error i am receiving now... I just reloaded all the previous files from Source Safe and I am now getting a message that says
Error creating form: Ancestor for 'TdmRenewalDate' not found.

Any ideas on this one?
 
It sounds like your files are being overwritten or your Delphi project has become confused. Check your Project paths and your Environment paths for duplicate files and missing files.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top