在usersessionunit中定义了
userid:integer;
username:string;然后在窗体frmLogin_unit中为两个变量赋值,然后在窗体frmMain_unit中设置一个IWLabel控件的caption属性值等于username,然后能正常编译。但是运行生成的服务器端程序就报错.用F9运行跟踪提示
Project catv.exe raised exception class EAccessViolation with message 'Access violation at address 004F452B in module 'catv.exe'.Read of address 00000064'. Process stopped.Use Step or Run to continue.停在ServerController的
function UserSession: TIWUserSession;
begin
  Result := TIWUserSession(WebApplication.Data);//报这个地方错误
end;实在是搞不明白了~请帮帮~谢谢

解决方案 »

  1.   

    userid:integer;
    username:string;
    你把它们定义在哪里??
      

  2.   

    这里定义的unit UserSessionUnit;{
      This is a DataModule where you can add components or declare fields that are specific to 
      ONE user. Instead of creating global variables, it is better to use this datamodule. You can then
      access the it using UserSession.
    }
    interfaceuses
      IWUserSessionBase, SysUtils, Classes;type
      TIWUserSession = class(TIWUserSessionBase)
      private
        { Private declarations }
      public
        userid:integer;
        username:string;
      end;implementation{$R *.dfm}end.
    我的是intraWeb 7.0
      

  3.   

    把userid:integer;
        username:string;
    定义在implementation前tIWusersession类后