K
Ktcs
Unregistered / Unconfirmed
GUEST, unregistred user!
各位庄家:
由于多人同时开发应用程序服务器,每人都建立自己的远程数据模块,其中一个数据模块调用另一个数据模块中定义的Object并给予赋值,结果程序提示灾难性错误,如何解决?
其中一个数据模块:
type
TDmMain = class(TRemoteDataModule, IDmMain)
private
{ Private declarations }
protected
public
end;
同时该模块中又定义如下的Object
TStaff = class(TObject)
private
function GetNextOfficeCode: string;
function GetAreaCode: string;
procedure FreeRights;
procedure GetRights;
public
//单位信息
DUTY_OFFICE_CODE: string;
DUTY_OFFICE_NAME: string;
//部门信息
DEPT_CODE: string;
DEPT_NAME: string;
//员工信息
STAFF_CODE: string;
STAFF_NAME: string;
STS: string;
LoginCryptogram: string;
//登录密码
LoginCode: string;
//登录员工号
RightList: TStringList;
//权限列表
procedure GetStaffInfo;
procedure RegLogoutSystem(var sLogon: string);
constructor Create;
destructor Destroy;
override;
protected
end;
同时定义
var
DMMain: TDMMain;
Me: TStaff;
另一个数据模块包含该单元uses udmmain;同时引用并赋值
type
TLogin = class(TRemoteDataModule, ILogin)
SPGetUser: TOraStoredProc;
SPGetPassWord: TOraStoredProc;
SP_GetSessionCount: TOraStoredProc;
SPKillCurrentSession: TOraStoredProc;
private
{ Private declarations }
protected
class procedure UpdateRegistry(Register: Boolean;
const ClassID, ProgID: string);
override;
function sp_get_username(const i_duty_office_code,
i_staff_code: WideString): WideString;
safecall;
function GetStaff_Code(const GetAreaCode,
EdStaff_Code: WideString): WideString;
safecall;
public
{ Public declarations }
end;
function TLogin.sp_get_username(const i_duty_office_code,
i_staff_code: WideString): WideString;
begin
result := 'Love'+copy(i_duty_office_code,3,6)+'00'+i_staff_code;
end;
//获得登录数据库的员工号,根据客户端的登录机关、员工号进行用户转换
function TLogin.GetStaff_Code(const GetAreaCode,
EdStaff_Code: WideString): WideString;
begin
Me.LoginCode := edStaff_Code;
Me.DUTY_OFFICE_CODE := GetAreaCode[red];--对另一个数据模块中的Object进行赋值[][/red] Result := sp_get_username(GetAreaCode,edStaff_Code);
end;
由于多人同时开发应用程序服务器,每人都建立自己的远程数据模块,其中一个数据模块调用另一个数据模块中定义的Object并给予赋值,结果程序提示灾难性错误,如何解决?
其中一个数据模块:
type
TDmMain = class(TRemoteDataModule, IDmMain)
private
{ Private declarations }
protected
public
end;
同时该模块中又定义如下的Object
TStaff = class(TObject)
private
function GetNextOfficeCode: string;
function GetAreaCode: string;
procedure FreeRights;
procedure GetRights;
public
//单位信息
DUTY_OFFICE_CODE: string;
DUTY_OFFICE_NAME: string;
//部门信息
DEPT_CODE: string;
DEPT_NAME: string;
//员工信息
STAFF_CODE: string;
STAFF_NAME: string;
STS: string;
LoginCryptogram: string;
//登录密码
LoginCode: string;
//登录员工号
RightList: TStringList;
//权限列表
procedure GetStaffInfo;
procedure RegLogoutSystem(var sLogon: string);
constructor Create;
destructor Destroy;
override;
protected
end;
同时定义
var
DMMain: TDMMain;
Me: TStaff;
另一个数据模块包含该单元uses udmmain;同时引用并赋值
type
TLogin = class(TRemoteDataModule, ILogin)
SPGetUser: TOraStoredProc;
SPGetPassWord: TOraStoredProc;
SP_GetSessionCount: TOraStoredProc;
SPKillCurrentSession: TOraStoredProc;
private
{ Private declarations }
protected
class procedure UpdateRegistry(Register: Boolean;
const ClassID, ProgID: string);
override;
function sp_get_username(const i_duty_office_code,
i_staff_code: WideString): WideString;
safecall;
function GetStaff_Code(const GetAreaCode,
EdStaff_Code: WideString): WideString;
safecall;
public
{ Public declarations }
end;
function TLogin.sp_get_username(const i_duty_office_code,
i_staff_code: WideString): WideString;
begin
result := 'Love'+copy(i_duty_office_code,3,6)+'00'+i_staff_code;
end;
//获得登录数据库的员工号,根据客户端的登录机关、员工号进行用户转换
function TLogin.GetStaff_Code(const GetAreaCode,
EdStaff_Code: WideString): WideString;
begin
Me.LoginCode := edStaff_Code;
Me.DUTY_OFFICE_CODE := GetAreaCode[red];--对另一个数据模块中的Object进行赋值[][/red] Result := sp_get_username(GetAreaCode,edStaff_Code);
end;