DELPHI Locate代码出错!

beginCount:=0;LoginUser:=UserCB.Text;ifLoginUser=''thenShowmessage('请确定用户名!');withDat... begin
Count:=0;
LoginUser:=UserCB.Text ;
if LoginUser='' then Showmessage('请确定用户名!');
with DataModule1.Table1 do
begin
if Locate('UserName',UserCB.Text ,[loCaseInsensitive]) then
begin
LoginPass:=Trim(Fields[1].AsString );
Inc(Count);
if LoginPass=Trim(PasswordEdit.text) then //程序有错,不能完成调用
Inc(Count)
else
ShowMessage('密码不对!');
end else
ShowMessage('用户不存在!');
if Count=2 then
GuestKind:=Fields[2].AsString
else
begin
if TryCount<3 then
begin
Inc(TryCount);
exit;
end else
Application.Terminate ;
end;
end;
Close;
end;
end;
end.

错误报告:
[错误] U_LoginForm.pas(84): Undeclared identifier: 'loCaseInsensitive'
[错误] U_LoginForm.pas(84): Incompatible types: 'TLocateOption' and 'Integer'
[错误] U_LoginForm.pas(88): Undeclared identifier: 'PasswordEdit'
[错误] U_LoginForm.pas(88): There is no overloaded version of 'Trim' that can be called with these arguments
[致命错误] BookTicket.dpr(8): Could not compile used unit 'U_LoginForm.pas'

请问那里出错了,是按书上篇的。
展开
 我来答
tevistang
2009-01-07 · TA获得超过504个赞
知道小有建树答主
回答量:662
采纳率:0%
帮助的人:474万
展开全部
1:loCaseInsensitive需要引用DB。
2:没找到哪句错,你把错误的那句贴出来。
3:你没有PasswordEdit这个东东,看名字应该是一个名字叫PasswordEdit的Edit输入框。
4:应该是有自定义函数与TRIM重名了。

不要什么照书上抄,自己先理解那些代码什么意思
现在世面上就没几本DELPHI的真正好书,90%都是骗钱的!
TheFiend
2009-01-07 · TA获得超过626个赞
知道大有可为答主
回答量:1346
采纳率:0%
帮助的人:1240万
展开全部
[错误] U_LoginForm.pas(84): Undeclared identifier: 'loCaseInsensitive' //这个变量未声明,可能你有的单元文件没有uses
[错误] U_LoginForm.pas(84): Incompatible types: 'TLocateOption' and 'Integer' //操作数的 数据类型不匹配.
[错误] U_LoginForm.pas(88): Undeclared identifier: 'PasswordEdit'
//同上,未声明变量
[错误] U_LoginForm.pas(88): There is no overloaded version of 'Trim' that can be called with these arguments
//trim函数的参数错了.这个函数只带一个参数
感觉是你没有uses单元.你在看看 你书上这个例子的文件头呐
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式