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

2021-09-30 17:01:07 字數 2207 閱讀 8232

private sub cmdcha_click()

'清空表內容,保留表頭

msflexgrid1.rows = 2

'表連線

strsql3 = "select * from line_info where cardno='" & trim(txtkahao.text) & "'" 'line??

set mrc3 = executesql(strsql3, msgstring)

strsql = "select * from student_info where cardno='" & trim(txtkahao.text) & "'and status='使用'"

set mrc = executesql(strsql, msgstring)

'空值if txtkahao.text = "" then

msgbox "沒有資料或卡號不存在", , "提示"

txtkahao.setfocus

exit sub

end if

'非註冊卡號

if mrc.eof then

msgbox "沒有資料或卡號不存在", vbokonly, "提示"

txtkahao.text = ""

txtkahao.setfocus

exit sub

else

'有效卡號,帶引號內容為上機時內容不全情況

do while not mrc3.eof

with msflexgrid1

.cellalignment = 4

.textmatrix(.rows - 1, 0) = trim(mrc3.fields(1))

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

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

.textmatrix(.rows - 1, 3) = trim(mrc3.fields(8)) & ""

.textmatrix(.rows - 1, 4) = trim(mrc3.fields(7))

.textmatrix(.rows - 1, 5) = trim(mrc3.fields(9)) & ""

.textmatrix(.rows - 1, 6) = trim(mrc3.fields(10)) & ""

.textmatrix(.rows - 1, 7) = trim(mrc3.fields(12))

.textmatrix(.rows - 1, 8) = trim(mrc3.fields(13))

end with

mrc3.movenext

'下面還有記錄時表下加一行直至記錄與行數一致

if mrc3.eof = false then

msflexgrid1.rows = msflexgrid1.rows + 1

end if

loop

end if

end sub

private sub cmddaochu_click()

'定義控制的行、列

dim i as integer

dim j as integer

'定義excel程式

'定義工作簿

dim xlbook as excel.workbook

'定義工作表

dim xlsheet as excel.worksheet

'空表情況

if msflexgrid1.text = "" then

msgbox "請先輸入卡號並且查詢資料後再匯出", , "提示"

txtkahao.setfocus

else

'物件例項化

'不斷例項化

'例項化工作表

set xlsheet = xlbook.worksheets(1)

'將表中的記錄匯入excel

for i = 0 to msflexgrid1.rows - 1

for j = 0 to msflexgrid1.cols - 1

xlsheet.cells(i + 1, j + 1) = "'" & msflexgrid1.textmatrix(i, j)

next

next

end if

end sub

機房收費系統 上機

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

機房收費系統 上機

上機在機房系統是至關重要的,只要捋清思路,把大問題分解成乙個個的小問題再去解決,困惑就自然迎刃而解了。來看看我的思路吧!片段 private sub cmdonline click dim txtsql as string dim msgtext as string dim mrc as adodb...

機房收費系統 上機

其實相比起下機,上機的功能相對簡單的多。我總結了一句話大概可以概括了上機的功能 讓賬戶裡錢夠的目前沒有上機的已經註冊過的使用者上機。關鍵點資料表 含義 賬戶裡的錢夠 student info 當使用者餘額高於最少錢數 目前沒有上機 online info online 表中不存在的使用者可上機 已經...