這是在做一個登錄視窗時,cb_login的腳本,但是一直登錄不上,資料庫里已經有資料了,而且連接成功,資料庫為sqlserver
string password,username
//判斷用戶名是否為空
if sle_1.text="" or sle_2.text="" then
messagebox("錯誤","用戶名或密碼不能為空!",exclamation!,ok!)
else
//檢索用戶名和密碼記錄
select 用戶名,密碼
into :username, :password
from t_operater
where t_operate.用戶名=sle_1.text;
// 判斷用戶名、密碼
if username=sle_1.text and password=sle_2.text then
open(w_main)
close(w_login)
else
messagebox("錯誤","用戶名或密碼錯誤,請重新輸入",exclamation!,ok!)
end if
end if
uj5u.com熱心網友回復:
看你的資料連接成功了沒有?sqlca.sqlerrtextuj5u.com熱心網友回復:
嵌入式的變數,要用冒號打頭string ls_uid
ls_uid = sle_1.text
select 用戶名,密碼
into :username, :password
from t_operater
where t_operate.用戶名=:ls_uid;
不知道t_operate.用戶名=:sle_1.text;
uj5u.com熱心網友回復:
1、檢查資料庫是否連接成功2、資料庫欄位不要用中文名
3、使用PB的單步執行功能,看看你從資料庫中取出的資料是否正確
uj5u.com熱心網友回復:
2樓所說 冒號:是關鍵....
where t_operate.用戶名=sle_1.text; //<---這個缺冒號
~~~~~~~~
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/24709.html
標籤:腳本語言
