![]() |
Datenbank: Mysql • Version: 5 • Zugriff über: Delphi xe5
Delphi Mysql passing Login data to another form
i have created 2 forms A login form & A main form i successfully logged in To the main form
here is the code that i use to login
Delphi-Quellcode:
i retrieve and validate logins from a unit class wich is Tloginclass ,,
SQL := Tloginclass.Create;
try SQL.Login:= trim(Usrnm.Text); SQL.passwd := trim(passwd.Text); if SQl.logins then begin LoginSuccess := True; end but now how to i set the data for each user logged in to the main form ? i try somthing like this after login
Delphi-Quellcode:
but this is not logical because this showing only text how the application know the differents between user who loggedin like there is bob and martin and james ,etc are online now and read there user names ? any idea about this iam trying to understand the logic of this concept.
Mainform.listusers.Items.Add(SQL.Login);
i ask this question on here : ![]() |
AW: Delphi Mysql passing Login data to another form
|
AW: Delphi Mysql passing Login data to another form
getting no answer there so i thought posting here will help me more .
|
AW: Delphi Mysql passing Login data to another form
Zitat:
|
AW: Delphi Mysql passing Login data to another form
Zitat:
|
AW: Delphi Mysql passing Login data to another form
You could store a reference to the corresponding login intance into the object field of the list element
|
AW: Delphi Mysql passing Login data to another form
Maybe this helps:
Delphi-Quellcode:
Now you see the name in the list and have access to the login instance.
Mainform.listusers.Items.AddObject(SQL.Login, SQL);
BTW: 'SQL' is not a good name for an instance of your TLoginClass. You should not name neither a class nor an instance after its implementation details. It is unimportant how your login class verifies the user. |
AW: Delphi Mysql passing Login data to another form
Zitat:
plus also i dont get the point on how to enable/disable some functionality of the application based on the specific user |
AW: Delphi Mysql passing Login data to another form
Zitat:
|
AW: Delphi Mysql passing Login data to another form
mysql can show you all actually logged-in-users with
SQL-Code:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:27 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz