[DUG] Chick or egg.
Jackson Gomes
jfdmg at hotmail.com
Sun Jun 24 23:30:13 NZST 2012
you basically uses your data module to concentrate DB stuff (querys, DB connection, etc), expose business rules, etc...
if your login form access your DB, you should do it from a central point, so you do not duplicate your code base.
A simple solution for your case (and in general, that's what needs to be done) is to have your data module instantiated before your login screen (because the DM is the central point for DB access,) and then use the data module to check the login.
procedure TForm1.Button1Click(Sender: TObject);begin DM.CheckLogin(UserName.text, Password.Text);end;
the code snippet above it just to give you an idea...
--Jackson
> I'm opening an MYSql file. I am reading data from a ini file to pre-populate
> the fLogin edit boxes.
>
> I can't open the SQL until I have logged in and the datamodule does not
> allow edit boxes.
>
> If I put the TMyConnection on a login page, the datamodule components can't
> find the tables, even if I add the fLogin to the uses list.
>
> If I put the TMyConnection on the DM page and the call fLogin with the on
> create, I get an access violation message. I assume it is because the DM has
> not fully created itself and the components.
>
> Any Suggestions ? One is having connection function left on the DM form but
> it references the parameters from fLogin.
>
> I guess having a window on the DM form would be the answer.
>
> Thanks Wallace.
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with Subject: unsubscribe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20120624/be0cb99f/attachment.html
More information about the Delphi
mailing list