数据库不能正确定位的问题,请大家帮我(0分)

  • 主题发起人 主题发起人 chatop
  • 开始时间 开始时间
C

chatop

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tvcd_login.BitBtn1Click(Sender: TObject);
begin
//用下面一条语句,应该可以将数据库当前记录位置定位到dbcombobox1当前的内容的那条记录上去,可是定位不了,不知道是怎么回事,请大家帮我
我要达到的目的就是用户名和密码验证,如果有更好的办法请告诉知我,谢谢
vcd_login.ADOTable1.locate('用户名',vcd_login.DBComboBox1.Items.text,[]);//将当前记录定位到dbcombobox选中的用户名上
if vcd_login.passedit.Text=vcd_login.ADOTable1.Fields[2].Value then//如果密码为对
begin
vcd_login.passedit.text:='对的';
end
else
begin
vcd_login.passedit.text:='错的';
end;
end;
 
vcd_login.ADOTable1.locate('用户名',vcd_login.DBComboBox1.text,[]);
//将当前记录定位到dbcombobox选中的用户名上
 
你这样子也是一样的,我试过不行的,不过我用combobox来代替dbcombobox就可以了,不知是不是
dbcombobox的bug
另外那个dbcombobox好像也不好使,不能自动读出数据库里面所有记录,要对数据库进行个个读取和combobox有什么不同?
看来还是用combobox好!
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部