Jump to content

The users share the same variables in DataModule?


pizzahut222
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...