| Subject |
Re: I give up - how to activate a datamodule in a form??? |
| From |
Geoff Wass [dBVIPS] <gswassREMOVE_ME@attglobal.net> |
| Date |
Sun, 17 Jan 2010 03:30:08 -0500 |
| Newsgroups |
dbase.getting-started |
In article <lRbc7IylKHA.1500@news-server>, jeh338NO_SPAM@att.net says...
> Datamodule code runs fine in dQuery. Proper links are in the code. Relationship between tables works, etc. When row is selected from 'master' table, then click on 2nd linked table proper row (or rows) show up (when running dQuery).
> But ... when drag datamodule onto a form, the datamodule won't activate (ie. links between tables don't show up on form). The "wizard" that created the form in the first place created a query for the one table selected (it wouldn't
allow selection of multiple tables). Field palet reflects all tables in database (am running against a Firebird back end) From what I can tell code behind the form is showing proper 'dataLink = blah blah' for any columns (fields) dragged
onto form from any table. Have tried hand coding another SQL statement from within the form for a second table. Have tried setting datamoduledatamodule code that is created when the datemodule is dragged onto the form to "active = true".
Have tried creating an SQL join file to link the tables. dBase either erases the code when switching back to designer or otherwise doesn't work. Tried creating a form (same one) without using the "wizard" and couldn't get ANY linkages to
activate.
> Frankly, am getting disgusted. Could EASILY set up a relation between two (or more) tables in dBase IV which would display on forms. But this is ridiculous. Anybody know what the secret is??? If so, perhaps some kind soul would tell me.
> Thanks.
> John
John,
To keep the designer from zapping anything special you have done, put the special code in the
form's onOpen. Anything that is in the constructor (that part between the CLASS and the first
FUNCTION) is vulnerable to the designer.
The wizard can handle tables but not datamodules. To use a datamodule, you need to do (as you
tried later) to create a form manually. You do not need to "activate" a datamodule and
normally not the QUERY objects it contains. It is easiest when you create a new form to drag
the datamodule on the form first and then do the visual controls. You should be able to
"datalink" those controls to the appropriate table and field in the datamodule.
Since you are starting out, here are some learning material you will find useful:
To learn more about dBASE:
1. Get the dBASE books by Ken Mayer: http://www.goldenstag.net/dbase/
Ken Mayer's site is also home to the dUFLP. It's a collection of useful program code and
classes that solve a wide variety of problems.
2. Follow the tutorials by Michael Nuwer:
http://www.mnuwer.dbasedeveloper.co.uk/dlearn/
3. Read the articles in the dBulletin. Jean-Pierre Martel is the editor of articles coming
from a number of your dBASE peers:
http://www.jpmartel.com/bulletin.htm
There are several mirror sites of the dBulletin, including http://dbase.com
4. Use the dBASE KnowlegeBase, news groups and Gold Site provided by Databased Intelligence
Inc. (dBI):
http://dbase.com
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada
.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
|
|