機房收費總結 學生上機狀態查詢

2021-08-14 09:55:05 字數 2661 閱讀 1879

所有學生下機

private sub cmdallstudown_click()

txtsql = "delete from online_info"

set mrc = executesql(txtsql, msgtext)

'將查詢內容顯示在**控制項中

with myflexgrid

.rows = 2 '兩行

.cellalignment = 4 '單元格內容居中,居中對齊

.textmatrix(0, 0) = "卡號"

.textmatrix(0, 1) = "學號"

.textmatrix(0, 2) = "姓名"

.textmatrix(0, 3) = "上機日期"

.textmatrix(0, 4) = "上機時間"

.textmatrix(0, 5) = "電腦號"

end with

msgbox "所有同學已下機!"

cmdallstudown.enabled = false

end sub

選中學生下線

private sub cmdchoosedown_click()

dim msgtext as string

myflexgrid.selectionmode = flexselectionbyrow '單擊的時候選擇的是整行

myflexgrid.focusrect = flexfocusnone '在當前單元的周圍畫乙個焦點框

myflexgrid.highlight = flexhighlightwithfocus '該值決定了所選定的單元是否突出顯示

with myflexgrid

if .rowsel = 0 then '選中行為第一行

msgbox "請選擇資料!", vbokonly, "提示"

exit sub

end if

if .rowsel >= 1 then

txtsql = "select * from online_info where cardno='" & trim(.textmatrix(.rowsel, 0)) & "'"

set mrc = executesql(txtsql, msgtext)

if mrc.eof = true then

msgbox "無上線人數!"

exit sub

else

.removeitem .rowsel

mrc.delete

end if

end if

end with

mrc.update

end sub

檢視全部

private sub cmdlookallstu_click()

myflexgrid.selectionmode = flexselectionbyrow '單擊的時候選擇的是整行

myflexgrid.focusrect = flexfocusnone '在當前單元的周圍畫乙個焦點框

myflexgrid.highlight = flexhighlightwithfocus '該值決定了所選定的單元是否突出顯示

txtsql = "select * from online_info" '檢視資料庫以得到所有上機同學的表

set mrc = executesql(txtsql, msgtext)

if mrc.eof = true then '判斷資料庫是否為空

cmdlookallstu.enabled = false

else

cmdlookallstu.enabled = true

end if

with myflexgrid '新增表頭

.rows = 1

.cellalignment = 4

.textmatrix(0, 0) = "卡號"

.textmatrix(0, 1) = "姓名"

.textmatrix(0, 2) = "上機日期"

.textmatrix(0, 3) = "上機時間"

.textmatrix(0, 4) = "機房號"

'將資料庫的值賦給**

do while not mrc.eof

.rows = .rows + 1

.cellalignment = 4

.textmatrix(.rows - 1, 0) = trim(mrc.fields(0)) & ""

.textmatrix(.rows - 1, 1) = trim(mrc.fields(3))

.textmatrix(.rows - 1, 2) = trim(mrc.fields(6))

.textmatrix(.rows - 1, 3) = trim(mrc.fields(7))

.textmatrix(.rows - 1, 4) = trim(mrc.fields(8))

mrc.movenext

loop

end with

mrc.close

myflexgrid.cellalignment = 4

end sub

機房收費系統 上機記錄查詢

private sub cmdcha click 清空表內容,保留表頭 msflexgrid1.rows 2 表連線 strsql3 select from line info where cardno trim txtkahao.text line?set mrc3 executesql strs...

機房收費 查詢 檢視學生餘額

最近在敲機房的檢視學生餘額,雖然看到很多人的物件視窗,知道怎麼弄 舞台 上的東西,可是 幕後 的東西一點頭緒都沒有,一行 的思路都沒有。經過看小夥伴的機房給我的啟示,突然發現怎麼如此的簡單。自己怎麼都沒有想到和學生的 沒有什麼差別啊!定義 判斷語句 查詢語句 給文字框賦值 優化的地方 限制文字框的輸...

機房收費系統 上機

檢查乙個卡號能否使用,需要檢查以下幾點 只有這幾點同時滿足,此卡才能正常上機。1 當然不用多說,不輸入卡號當然不能使用。2 與要求的最小餘額進行比較,小於最小餘額則禁止上機使用 3 此卡沒用註冊,登錄檔中沒有這條記錄 4 次卡正在處於上機狀態,提示正在上機,一卡禁止重複上機使用 下面的這段 僅為借鑑...