我撰寫了一個新用戶注冊,編譯通過,其他功能都能實作,就是注冊時資料怎么也寫不進資料庫中…… 請大蝦們指導下。
string ps_id
string passid,pass,newpass
string err
passid=sle_111.text
pass=sle_112.text
newpass=sle_113.text
err=""
if passid="" then
err="用戶ID不能為空!~n"
end if
if pass="" then
err=err + "密碼不能為空!~n"
end if
if newpass="" then
err=err + "重復密碼不能為空!~n"
end if
if pass<>newpass then
err=err+"密碼和重復密碼不同,請重新輸入!~n"
sle_112.text=""
sle_113.text=""
end if
if err<>"" then
messagebox("錯誤警告!",err)
return
end if
select "name"
into :ps_id
from login
using sqlca;
if ps_id=passid then
messagebox("系統警告:","此用戶ID已經存在,請重新輸入!")
sle_111.text=""
return
end if
INSERT INTO login ( name,password )
VALUES ( :passid, pass)
using sqlca;
messagebox(",","新用戶注冊成功!")
uj5u.com熱心網友回復:
INSERT INTO login ( name,password )VALUES ( :passid, pass)
using sqlca;
if sqlca.sqlcode=-1 then
messagebox('','失敗')
else
commit;
messagebox(",","新用戶注冊成功!")
end if
uj5u.com熱心網友回復:
同意樓上,sql語法錯誤了,pass的冒號沒了uj5u.com熱心網友回復:
select "name"into :ps_id
from login
using sqlca;
這個陳述句也有問題,如果你表里有多條資料的話,根本就無法取到值
uj5u.com熱心網友回復:
已經解決,謝謝uj5u.com熱心網友回復:
有沒有PB高手能來兼職當培訓講師的?如有感興趣的朋友,請將簡歷發至:[email protected],請聯系:QQ:174629429 MSN:[email protected]轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/109304.html
標籤:腳本語言
