提示
string username,password //如果s_yonghu.yhzh, s_yonghu.yhmm 都是字符型的话,正确Long ll_cnt
username=trim(sle_1.text)
password=trim(sle_2.text)
SELECT COUNT(*)
INTO :ll_cnt
FROM s_yonghu
WHERE ( s_yonghu.yhzh = :username ) AND
( s_yonghu.yhmm = :password )
; //一定要有" 分号 "
IF ll_cnt > 0 THEN
//登录
CLOSE(parent)
open(主窗口)
ELSE
messagebox("警告","用户名密码错误",stopsign!,ok!,1)
sle_1.text=""
sle_2.text=""
return
END IF
//-----------------------------------------------------------------------------------------------
//如下是原代码 ,bt_登录 Clicked
//-----------------------------------------------------------------------------------------------
string username,password
username=trim(sle_1.text)
password=trim(sle_2.text)
// SELECT s_yonghu.yhzh,
// s_yonghu.yhmm
//FROM s_yonghu
//WHERE ( s_yonghu.yhzh = :username ) AND
// ( s_yonghu.yhmm = :password )
if SQLCA.SQLCODE<>0 THEN
messagebox("警告","用户名密码错误",stopsign!,ok!,1)
sle_1.text=""
sle_2.text=""
return
end if
messagebox("信息","数据库连接成功",information!,ok!,1)
close(parent)