又及:
我使用下面这段代码来判断查询结果是否为空,请问对不对?有没有更好的办法?
adouser.Close;
adouser.SQL.Clear;
adouser.SQL.Add('select * from userpass where name=:name and password=:password');
adouser.Parameters.ParamByName('name').value:=name;
adouser.Parameters.ParamByName('password').value:=password;
adouser.Open
if adouser.Eof then result:=false // <---- 此句用来判断结果
else result:=true;
我使用下面这段代码来判断查询结果是否为空,请问对不对?有没有更好的办法?
adouser.Close;
adouser.SQL.Clear;
adouser.SQL.Add('select * from userpass where name=:name and password=:password');
adouser.Parameters.ParamByName('name').value:=name;
adouser.Parameters.ParamByName('password').value:=password;
adouser.Open
if adouser.Eof then result:=false // <---- 此句用来判断结果
else result:=true;
另外:用EOF或者BOF来判断结果数量都不太好.还是用recordcount属性
判断他是不是为0就可以了
可改为:
adouser.Close;
adouser.SQL.Clear;
adouser.SQL.Add('select * from userpass where name='+name
+' and password='+password);
adouser.Open
也听说ado有BUG,具体也不太清楚。
所以眼前是不可能升级到D6的,因为那样工作量很大,
如果要升级ADO的话,应该到那里下载升级程序?
应该怎样升级?
官方站点!
if not ADOQuery1.IsEmpty then
begin //不空
end
else //空
adouser.Close;
adouser.SQL.Clear;
adouser.SQL.Add('select * from userpass where name=:name and password=:password');
adouser.Parameters.ParamByName('name').value:=name;
adouser.Parameters.ParamByName('password').value:=password;
adouser.Open if adouser.Eof then result:=false // <---- 此句用来判断结果
else result:=true; 不能这样判断应该
if (adouser.Eof and adouser.bof)
then result:=false // <---- 此句用来判断结果
else result:=true;
或者
if (adouser.recordcount<1)
then result:=false // <---- 此句用来判断结果
else result:=true;
你给我的这个是BCB的呀,我需要一个DELPHI5的补丁
我已经下载到补丁了,但是在安装的时候要输入口令;
口令的格式与D5的安装口令相同,我输入了D5的安装口令;
ski-hd3-c139,92x0,92x1,但是无效,
有没有那位兄弟知道这个补丁的口令?
ski-hd3-c139-92x0-91x0
方法很多!
1,就是按照上面各个老兄说得,Ado升级.升级密码与delphi的一样,因为这个是delphi的ado问题.
2,将query的lockType的属性改为ltUnspecified 也同样可以解决问题!
3,关于兼容问题,你说的不对,delphi6当然可以打开编译Delphi5的文件.反之不行的!但也有小软件将delphi6的文件反相生成delphi5文件的!
我使用了ADO升级的办法,但是升级后dclado50.bpl无法加载,就是在面板上所有的ADO组件没有了,不知是什么原因,请有碰到相同问题的兄弟指点,TO:zhangxzh(报表之王) 兄弟
你说的第2个方面我还没有试过,我马上就试,谢谢你的指点,关于你说的第三点因为我以前碰过在D5下面的很多第三方控件在D6下都用不了,同样很多D4的的控件没办法在D5上使用
adouser.recordset.close; //增加这一句。
adouser.Close;
adouser.SQL.Clear;
adouser.SQL.Add('select * from userpass where name=:name and password=:password');
adouser.Parameters.ParamByName('name').value:=name;
adouser.Parameters.ParamByName('password').value:=password;
adouser.Open