pizzahut222 Posted January 29, 2012 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 Quote
zilav Posted January 29, 2012 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. Quote
Administrators Farshad Mohajeri Posted January 29, 2012 Administrators Posted January 29, 2012 Global variables shouldn't be used in uniGUI. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.