Solved

IDE's first form opened

Posted on 2004-04-15
4
161 Views
Last Modified: 2010-04-05
My application has a Data module that has a TADOConnection control which the other forms use to access an Access database.

At design time when I try to open any form that has controls that referance this Modual when this modual is not open before-hand, Delphi (6) bombs out and closes itself.

Till now I have lived with this but now my 'Projects/Options/Main Form' needs to referance this Modual.

Iv noticed that the IDE automatically loads the Main Form when a project is opened. You can imagin the problem this causes. Now whenever I attempt to open such a project, Delphi automatically bombs out!

What do I do?

Is it possible to make the IDE to load up the Modual first before any other form?

How do you make the IDE load a form/modual, other than the Main Form, first when a project is opened?
0
Comment
Question by:ziche
  • 2
4 Comments
 
LVL 17

Expert Comment

by:mokule
Comment Utility
Hi
You've got two possibilities.
1. In Project/Options/Auto create Forms drag Your data module to the first place.
2. Change order in dpr file
0
 

Author Comment

by:ziche
Comment Utility
1. The module is already at the top, this doesnt help.
2. How do I do this exactly?
0
 
LVL 17

Expert Comment

by:mokule
Comment Utility
Hi
Ad 2.
Just Cut Line and copy earlier or later. But it is equivalent to method 1. The only difference is that You can do it without opening project..

What You've got in Your project's *dsk.
Try to change section [Modules]
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 40 total points
Comment Utility
ziche,

Initially, in your project source, you will have something like this....

program Project1;

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

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TDataModule2, DataModule2);
  Application.Run;
end.

Switch it around so that the DataModule is created first....

 Application.Initialize;
 Application.CreateForm(TDataModule2, DataModule2);
 Application.CreateForm(TForm1, Form1);
 Application.Run;


Hope this helps!

SHane
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now