Jump to content

Module cannot be found in the current project


mierlp

Recommended Posts

Hi

 

For some reason i got these error message when compiling. See first attachment.

The form is part of the project, See second image

 

This is random, not always the same module

 

...or the project is to big  with 152 .pas and .dfm files or it's a 'bug' ?

 

I use Delphi Tokyo 10.2.2.and uniGui 1.10.0.1472

 

 

post-510-0-05059000-1534756287_thumb.png

post-510-0-63847400-1534756296_thumb.png

Link to comment
Share on other sites

See attachement. The file IS loaded in the IDE.

 

I think the problem occurs when you link to a form which contains the datasource
which you use on this form. That's my situation.

 

FormTableAdmission contains the datasources,

FormTableAdmissionReport is linked to FormTableAdmission

post-510-0-93894700-1534971103_thumb.png

Link to comment
Share on other sites

Did someone has/found a solution because is a big issue

 

The alternative (must try it) is to move the datasource to

the datamodule.

 

I don't have the problem creating the same application as a

Windows vcl  appliction.

  • Upvote 1
Link to comment
Share on other sites

Did some test 4 forms and moved the datasources to the datamodule.

In that case you don't get the error message

 

The forms which still have the link to the form with the datasource the issue
is still there.

 

It's not the way i was hoping for...now i have a lot of working

moving datasources to datamodules and normally you put

datasources on the form, not on the datamodule.

 

I hope Farshad is coming with a solution, i have created a ticket
regarding this issue. I don't think it's a Delphi thing because my

VLC application don't have there issues. And that are all application

with datasources on the forms.

 

Maybe others have a beter solutions...

Link to comment
Share on other sites

  • Administrators
I know this problem can occur when you link one form to another component on another form.

I discourage this design approach because in uniGUI forms are transient objects.

You must use DataModules (which are created from uniGUI wizard) for this purpose. Using forms may cause erratic behavior because in uniGUI forms are destroyed as soon as they are closed.

 

After all, I don't think this design approach is encouraged in VCL too. DataModules are designed for this specific purpose.

Link to comment
Share on other sites

  • Administrators

Did some test 4 forms and moved the datasources to the datamodule.

In that case you don't get the error message

 

The forms which still have the link to the form with the datasource the issue

is still there.

 

It's not the way i was hoping for...now i have a lot of working

moving datasources to datamodules and normally you put

datasources on the form, not on the datamodule.

 

I hope Farshad is coming with a solution, i have created a ticket

regarding this issue. I don't think it's a Delphi thing because my

VLC application don't have there issues. And that are all application

with datasources on the forms.

 

Maybe others have a beter solutions...

 

If data aware component is on Form A and its datasource is on Form B then move datasource to Form A.

If datasource is commonly used by more than one form then move it to a DataModule.

Link to comment
Share on other sites

If data aware component is on Form A and its datasource is on Form B then move datasource to Form A.

If datasource is commonly used by more than one form then move it to a DataModule.

 

I agree, this is the approach I always use: datasource on the same form as data aware component.

 

I also - in OnCreate on all forms - assign the database to the queries programmatically, as these did get lost.

 

I also open the MainModule - which has the database all other forms link to - before I open other forms, at project load.

 

Doing this, I never get this link issue mentioned above, and it all works perfectly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...