这个就是个简单的登陆,和权限管理代码如下:
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
Query1.Active:=false;
Query1.ParamByName('user_style').AsString:= ComboBox1.Text;
Query1.ParamByName('password').AsString:= Edit1.Text;
Query1.Active:=true;
if(Trim(ComboBox1.Text)='超级用户')and(Trim(Edit1.Text)='password') then
begin
Form1.Show ;
ComboBox1.Clear;
Edit1.Clear;
end else if(Trim(ComboBox1.Text)='')or(Trim(Edit1.Text)='') then
begin
ShowMessage('用户类型或者口令不能为空!');
end
else if Query1.Eof then
begin
ShowMessage('用户类型或者口令不正确!');
end
else if(Trim(ComboBox1.Text)='学籍管理员') then
begin
Form1.Show;
Form1.N1.Enabled:=False;
Form1.N3.Enabled:=False;
end
else if(Trim(ComboBox1.Text)='档案管理员') then
begin
Form1.Show;
Form1.N1.Enabled:=false;
Form1.N2.Enabled:=false;
end
end;
end.也是同样的问题,运行通过,操作时就会有错误!
错误信息是:Access violation at address 0045f3b2 in module. 'Project1.exe'.Read of address 000002f4.
还是得请个位高人帮忙啊!
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
Query1.Active:=false;
Query1.ParamByName('user_style').AsString:= ComboBox1.Text;
Query1.ParamByName('password').AsString:= Edit1.Text;
Query1.Active:=true;
if(Trim(ComboBox1.Text)='超级用户')and(Trim(Edit1.Text)='password') then
begin
Form1.Show ;
ComboBox1.Clear;
Edit1.Clear;
end else if(Trim(ComboBox1.Text)='')or(Trim(Edit1.Text)='') then
begin
ShowMessage('用户类型或者口令不能为空!');
end
else if Query1.Eof then
begin
ShowMessage('用户类型或者口令不正确!');
end
else if(Trim(ComboBox1.Text)='学籍管理员') then
begin
Form1.Show;
Form1.N1.Enabled:=False;
Form1.N3.Enabled:=False;
end
else if(Trim(ComboBox1.Text)='档案管理员') then
begin
Form1.Show;
Form1.N1.Enabled:=false;
Form1.N2.Enabled:=false;
end
end;
end.也是同样的问题,运行通过,操作时就会有错误!
错误信息是:Access violation at address 0045f3b2 in module. 'Project1.exe'.Read of address 000002f4.
还是得请个位高人帮忙啊!
解决方案 »
- 关于命令执行过程中的进度条的问题。还是老问题没人回答完全的
- ReadProcessMemory读取进程数组的问题
- 大家都来看看chin_chen的真实面目!
- 如何用delphi把程序做成ocx,通过网页调用呢?
- [求助]关于用dispose释放内存的问题
- 高分求助!
- 創建MDI程序,在顯示主窗體的同時,顯示登陸子窗體,此時要登陸成功后才能操作主窗體
- 这些东东怎么用?
- 用delphi 能不能编写在linux中运行的程序?
- 窗体显示问题,新手求助!
- 求助:各位大哥怎么会出现这样的怪问题,来帮帮我把!谢谢!
- ADOQuery执行查询时出现Cannot perform this operation on a closed dataset
form1 :=tform1.create(application);
form1.show
第二,你在FORM2 里调用FORM1 并SHOW出来,必需要先创建,才能SHOW的,
你在内存里,都还没有给它分配内存,就想把它给SHOW出来,当然会出错的,
如果是自动创建的,只需要引用哪个单元,就可以直接,.show出来。
也就是编绎器自动来为你分配内存。
如果你是available的,必需要手工能创建,明白了吗?