Forum > Databases

datamodul "unit not used" (IBX)

(1/4) > >>

The base information about my database is in a unit of the type datamodule.
There you can find the path, the name, the logon and the transaction.

All data-sensitive units have this db-modul in their uses clauses.
The TBQueries are in the units, where they have their context.

I do not know if this is "good style", at least it works fine for me.

Nevertheless, I get the hint, that the units "have the datamodul is in the uses clause, although not needed".
And ideas what to do?

How do you connect the database component (which is in the dayamodule I assume) to the query component in the unit if the datamodule is not in the uses clause? That shouldn't work.

What is the exact hint?
And what happens if you remove the datamodule from the uses clause?
And how are you connecting the database to the query, via code or object inspector?

If it's code, show those lines (and are you sure the database is in the datamodule).


--- Quote ---Nevertheless, I get the hint, that the units "have the datamodul is in the uses clause, although not needed".
And ideas what to do?
--- End quote ---

Not a big problem itself, but you'd better remove them.

Sometime later, you may want to add another unit in the uses clause, but this time you have missed including the new unit. In this case the program should not work, but it may be working because inadvertently there happen to be a variable of same name in the old datamodule, etc.

The arrangement is like this:

I drop an TBQuery onto my TFrame
This IBQuery I set to "allow auto activate transaction".

With new frames I had a problem of which I am not sure, how I solved it, because I tried much and copied a working thing into a non-working or so.

The problem was this:
In the property of the IBQuery there was nothing to choose in the field of database. If I key it in by hand, it did not work. And this is the reasong, why I hesitate to delete this
"uses mydatamodul"

I fear, that the stuck-situation will return, that the Frame / IBQuery does not allow me to set the database-property, if I delete the db-module out of the uses-clause.

The data-modul IS used. I get from there: database1, connection1, transaction1

(and.: Thank you so much to the IBX-creators, it works that great and easy once it is set up!)

In that case you should have datamodule in uses clause.


[0] Message Index

[#] Next page

Go to full version