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;
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;