关于登陆窗口出错代码(20分)

  • 主题发起人 kof_123456
  • 开始时间
K

kof_123456

Unregistered / Unconfirmed
GUEST, unregistred user!
各位老大:大家好!.有谁能否帮我解决这个问题..在制作登陆窗口运行时出现以下错误提示:<br>Project PCGL exe raised exception class EAccessviolation with message'access violation at address 0040421C in module 'PCGL.exe '.Write of address 00000338'.<br>Process stopped Use step or Run to continue
 
既然已经提示“Process stopped Use step or Run to continue”,你就可以在集成调<br>试环境中定位到出错的具体方法——只要在这个方法的最前面的可执行代码行(紧跟begin<br>的第二行)设置断点,下次运行就可以在此处暂停,此时你再用F7或F8单步运行,看看到底<br>是哪一行出问题。
 
看楼主上边的提示,应该是查询条件时数据类型不匹配的问题,也就是界面上给出的数据类型与数据库里边的类型不匹配.你可以用单步或SHOWMESSAGE一步步看,这很好解答的了.
 
还是不行啊.我把界面上给出的数据类型与数据库设成一置.不是无法登陆
 
不行啊.:我这段登陆代码不知道有没有问题..按运行又没有出错.但是点单击登陆按扭.无反映 &nbsp;procedure Tloginform.RzBitBtn1Click(Sender: TObject);<br>begin<br>&nbsp; hostform.Auser.UserID := conn.Quser.FieldByName('id').AsString;<br>&nbsp; hostform.Auser.UserName := conn.Quser.FieldByName('username').AsString;<br>&nbsp; if conn.Quser.FieldByName('id').AsString = '' then<br>&nbsp; &nbsp; MessageBox(0, '没有存在用户,请预先设定好用户', '', MB_OK +<br>&nbsp; &nbsp; &nbsp; MB_ICONINFORMATION);<br>&nbsp; if Trim(Password.Text) = conn.Quser.FieldByName('password').AsString then<br>&nbsp; begin<br>&nbsp; &nbsp; Close;<br>&nbsp; &nbsp; &nbsp; conn.Quser.Open;<br>&nbsp; &nbsp; &nbsp; end<br>&nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; MessageBox(0, '使用者代号或通行密码错误,请重新输入!' + #13#10 +<br>&nbsp; &nbsp; '并请确定您有进入的权限。', '', MB_OK + MB_ICONSTOP);<br>&nbsp;if iTimes = 3 then<br>&nbsp; begin<br>&nbsp; &nbsp;MessageBox(0, '您进行系统身份确认程序错误已经超过3次,本系统将停止执行!',<br>&nbsp; &nbsp; &nbsp; '', MB_OK + MB_ICONSTOP);<br>&nbsp; &nbsp; Application.Terminate;<br>end;<br>&nbsp; UserName.SetFocus;<br>end;
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
822
import
I
顶部