做圖書管理系統
表state用來存盤書籍的編號bno和借閱者id
用戶輸入bno和id,點借書即可
圖書在庫的時候id記錄為0,借書后id存入借書者的id
實作的時候,到表里搜索書籍編號,但是有個問題,搜到編號后,怎么修改id的資料
不知道怎么指向這一行
下面是我的代碼:
string ls_bno,ls_id//,ls_ps1,ls_ps2
ls_bno=trim(sle_bno.text)
ls_id=trim(sle_id.text)
select bno,id into :ls_ps1,:ls_ps2
from state
where bno = :ls_bno and id = : ls_id ;
if sqlca.sqlcode = 100 then
MessageBox('錯誤','用戶錯誤,請重新輸入!')
return
end if
if sle_bno.text=ls_bno then
做到這不知道怎么寫了
請多多指導~
謝謝了
uj5u.com熱心網友回復:
你前面寫得也有問題!這不能這么判斷!你得去用戶表中找
select bno,id into :ls_ps1,:ls_ps2
from state
where bno = :ls_bno and id = : ls_id ;
if sqlca.sqlcode = 100 then
MessageBox('錯誤','用戶錯誤,請重新輸入!')
return
end if
修改
update id = :ls_id
from state where bno = :ls_lbn ;
uj5u.com熱心網友回復:
感覺思路有問題,你錄入時就是用戶編號和書號,為什么又去查詢這兩個號呢?如果要判斷得判斷書借出了沒有,如果沒有借出則可以借出。轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/106302.html
標籤:數據庫相關
上一篇:odbc資料庫連接
