1樓:匿名使用者
用控制元件吧,簡單!
剛剛回答了一個資料庫的問題,也給你這段**,自己改一下!
private sub commanddelete_click()
dim i as integer
i = msgbox("是否真的要刪除該記錄?", vbquestion + vbyesno, "record delet")
if i = 6 then
me.dataincome.recordset.delete
me.dataincome.refresh
totalincome = 0
themonthincome = 0
thedayincome = 0
totalnotpay = 0
themonthnotpay = 0
thedaynotpay = 0
on error resume next
me.dataincome.recordset.movefirst
do while not me.dataincome.recordset.eof
if left$(me.texttime1.text, 10) = left$(me.
dataincome.recordset.fields("受理時間"), 10) then
if me.dataincome.recordset.fields("狀態") then
thedaynotpay = thedaynotpay + me.dataincome.recordset.fields("專案金額")
end if
thedayincome = thedayincome + me.dataincome.recordset.fields("專案金額")
end if
if left$(me.texttime1.text, 7) = left$(me.
dataincome.recordset.fields("受理時間"), 7) then
if me.dataincome.recordset.fields("狀態") then
themonthnotpay = themonthnotpay + me.dataincome.recordset.fields("專案金額")
end if
themonthincome = themonthincome + me.dataincome.recordset.fields("專案金額")
end if
if me.dataincome.recordset.fields("狀態") then
totalnotpay = totalnotpay + me.dataincome.recordset.fields("專案金額")
end if
totalincome = totalincome + me.dataincome.recordset.fields("專案金額")
me.dataincome.recordset.movenext
loop
me.textthedayincome.text = thedayincome
me.textthedaynotpay.text = thedaynotpay
me.textthemonthincome.text = themonthincome
me.textthemonthnotpay.text = themonthnotpay
me.texttotalincome.text = totalincome
me.texttotalnotpay.text = totalnotpay
me.commandchange.enabled = false
me.commanddelete.enabled = false
me.timerrefresh.enabled = true
me.textitem.text = ""
me.textsum.text = "0.00"
me.textforegift.text = "0.00"
me.textname.text = ""
me.texttime2.text = ""
me.liststate.text = "已結算!"
me.texttime1.text = format(now, "yyyy.mm.dd hh:mm:ss")
me.texttime1.setfocus
me.texttime1.setfocus
me.msflexgridincome.toprow = me.dataincome.recordset.recordcount
else
exit sub
end if
end sub
2樓:匿名使用者
二樓的寫的好麻煩啊!!!用ado控制元件就可以把資料庫跟vb連線起來了, 至於ado控制元件怎麼用可以去買本看於ado控看的書看看吧!嘿
3樓:手機使用者
vb 區域網access資料庫,vb 區域網ACCESS資料庫
沒那麼複雜,你要的話給你來一個。你可以去 http www.codesky.net 找個例項,如果你要對區域網的資料庫進行修改,那麼資料路徑前加上 伺服器的ip 就可以了 大概的語句如下 sub test dim cn as adodb.connectiondim rs as adodb.recor...
VB迴圈搜尋的問題,VB 一個迴圈搜尋的問題
本程式是用right 和 left 兩個函式對字串進行操 作。先取字串長存在num中,再從後往前依次取倒數 第1 2 3.直到第num個字串,並在取完後對字元 穿首字元進行判斷,如果是a則得到a在整個串中的倒 數位置並存於i中,再用整串的長相減便得所需結果 sub commond click dim...
用vb在access資料庫中建立檢視(就是建立個查詢
路子沒什麼問題。你一步一步的試驗吧。從 create view query4 as select from ad order details 開始。一條一條的往上加,看看加誰會出錯。你的 沒反應 是什麼意思呢?修改表結構本來就不會有返回值,你只要檢查該查詢是否建立就可以了。如果你要執行該查詢,在建立...