begin
adodataset1.commandtext:='select * from 用户操作表 where 用户名='''+suiedit1.text+''' and 密码='''+suiedit2.text+'''' ;
adodataset1.Close;
if suiedit1.Text:=用户名 and =suiedit2.Text:=密码 then
begin
suimsnpopform1.Popup;
end
else
begin
if MessageDlg('您输入的用户名和密码错误,请检查!',mtwarning,[mbok,mbcancel],0)=mrok then suiedit1.Text:='';
suiedit2.Text:='';
suiedit1.SetFocus;
end;
end;上面这段程序中的这行语句
if suiedit1.Text:=用户名 and =suiedit2.Text:=密码 then
应该怎么写才对。(数据库中2个字段:用户名和密码)
adodataset1.commandtext:='select * from 用户操作表 where 用户名='''+suiedit1.text+''' and 密码='''+suiedit2.text+'''' ;
adodataset1.Close;
if suiedit1.Text:=用户名 and =suiedit2.Text:=密码 then
begin
suimsnpopform1.Popup;
end
else
begin
if MessageDlg('您输入的用户名和密码错误,请检查!',mtwarning,[mbok,mbcancel],0)=mrok then suiedit1.Text:='';
suiedit2.Text:='';
suiedit1.SetFocus;
end;
end;上面这段程序中的这行语句
if suiedit1.Text:=用户名 and =suiedit2.Text:=密码 then
应该怎么写才对。(数据库中2个字段:用户名和密码)
adodataset1.Close;
adodataset1.commandtext:='select * from 用户操作表 where 用户名='''+suiedit1.text+''' and 密码='''+suiedit2.text+'''' ;
adodataset1.Open;
(suiedit2.Text=AdoDateSet1.fieldByName('密码').AsString )then
(suiedit2.Text=AdoDateSet1.fieldByName('密码').AsString )then
这行还是出错
提示undeclared identifier 'adodataset1'
adodataset1.commandtext:='select * from 用户操作表 where 用户名='''+suiedit1.text+'''' ;
adodataset1.Close;
if (suiedit2.Text=AdoDateSet1.fieldByName('密码').AsString )then
begin
suimsnpopform1.Popup;
end
else
begin
if MessageDlg('您输入的用户名和密码错误,请检查!',mtwarning,[mbok,mbcancel],0)=mrok then suiedit1.Text:='';
suiedit2.Text:='';
suiedit1.SetFocus;
end;
end;
这句话不行的呀
我改成if suiedit2.Text='密码' then 这样可以运行的
但是运行后每次都是跳出“您输入的用户名和密码错误,请检查”
不知道是哪个循环里出了错,请帮我一起看一下
adodataset1.close;
adodataset1.commandtext:='select * from 用户操作表 where 用户名='''+suiedit1.text+''' and 密码='''+suiedit2.text+'''' ;
adodataset1.open;
if (suiedit1.Text=AdoDateSet1.fieldByName('用户名').AsString) and (suiedit2.Text=AdoDateSet1.fieldByName('密码').AsString) then
suimsnpopform1.Popup
else
begin
if MessageDlg('您输入的用户名和密码错误,请检查!',mtwarning,[mbok,mbcancel],0)=mrok then
begin
suiedit1.Text:='';
suiedit2.Text:='';
suiedit1.SetFocus;
end;
end;
end;
这句话不行的呀
我改成if suiedit2.Text='密码' then 这样可以运行的
但是运行后每次都是跳出“您输入的用户名和密码错误,请检查”
不知道是哪个循环里出了错,请帮我一起看一下
adodataset1.close;
adodataset1.commandtext:='select * from 用户操作表 where 用户名='''+suiedit1.text+''' and 密码='''+suiedit2.text+'''' ;
adodataset1.open;