Solved

IDE's first form opened

Posted on 2004-04-15
4
167 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
ID: 10839859
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
ID: 10842778
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
ID: 10842926
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
ID: 10846484
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
find a node in VST 2 73
Why can't I create any project with my delphi EXE file? 6 39
Convert MS Word document to a PDF file 9 92
Multi-layered image in FireMonkey 9 49
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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 shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 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