pizzahut222 Posted January 29, 2012 Share Posted January 29, 2012 unit UntDM; interface uses SysUtils, Classes, DB, DBAccess, Uni, UniProvider, MySQLUniProvider, MemDS; type TDM = class(TDataModule) Connection: TUniConnection; MySQLUniProvider1: TMySQLUniProvider; private { Private declarations } public { Public declarations } end; type InfosInscription=record strNom: String; strPrenom: String; idActif: Integer; idClasse: Integer; idInscription: integer; idIntroducteur: integer; idFacture: integer; bEE: boolean; end; var gl_Etudiant: InfosInscription; implementation {$R *.dfm} uses UniGUIVars, uniGUIMainModule, MainModule; ---------------------------------------------------------------- So, the clients or users share the same variable 'gl_Etudiant'? This is a big problem!!! Thanks! Delphi2009+unigui 86.0.888 Link to comment Share on other sites More sharing options...
zilav Posted January 29, 2012 Share Posted January 29, 2012 Yes, it is a global variable. If you want variables per user session, put them inside datamodule's class. Create an object from this class for every session, for example inside UniMainModule.OnCreate. Or just put your DB access components and variables inside UniMainModule - it is a DataModule unique for every session (connected user), automatically created and destroyed by UniGui for each user. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted January 29, 2012 Administrators Share Posted January 29, 2012 Global variables shouldn't be used in uniGUI. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now