Jump to content

The users share the same variables in DataModule?


pizzahut222

Recommended Posts

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...