機房收費系統之收取金額和退還金額查詢

2021-09-26 21:23:27 字數 2847 閱讀 1635

收取金額流程圖

**實現

private sub cmdexport_click()

call exporttoexcel(msflexgrid1)

end sub

private sub cmdinquery_click()

dim txtsql, msgtext as string

dim mrc as adodb.recordset

'判斷起始日期是否小於終止日期

if dtpicker1.value < dtpicker2.value then

'查詢退卡表

txtsql = "select * from recharge_info where datetime between '" & dtpicker1.value & "' and '" & dtpicker2.value & "' "

set mrc = executesql(txtsql, msgtext)

'判斷是否有記錄

if mrc.eof and mrc.bof then

msgbox "沒有查詢結果!", 0 + 48, 提示

exit sub

else

with msflexgrid1

'設定**行數和列數

.rows = 1

.cols = 6

'設定**第一行的標題

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

.textmatrix(0, 1) = "充值金額"

.textmatrix(0, 2) = "充值日期"

.textmatrix(0, 3) = "充值教師"

.textmatrix(0, 4) = "結賬狀態"

'將資料新增到**中

do while mrc.eof = false

.rows = .rows + 1

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

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

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

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

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

mrc.movenext

loop

end with

end if

else

msgbox "起始日期不能大於終止日期!", 0 + 48, 提示

exit sub

end if

end sub

退還金額流程圖

**實現

private sub cmdexport_click()

'匯出到excel

call exporttoexcel(msflexgrid1)

end sub

private sub cmdinquery_click()

dim txtsql, msgtext as string

dim mrc as adodb.recordset

'判斷起始日期是否小於終止日期

if dtpicker1.value < dtpicker2.value then

msgbox "起始日期不能大於終止日期!", 0 + 48, 提示

exit sub

end if

'判斷是否有記錄

txtsql = "select * from cancelcard_info where datetime between '" & dtpicker1.value & "' and '" & dtpicker2.value & "' "

set mrc = executesql(txtsql, msgtext)

if mrc.eof and mrc.bof then

msgbox "沒有查詢結果", 0 + 48, 提示

exit sub

else

'將查詢結果顯示在msflexgrid1中

with msflexgrid1

.rows = 1

.cols = 6

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

.textmatrix(0, 1) = "退還金額"

.textmatrix(0, 2) = "退還日期"

.textmatrix(0, 3) = "結賬人員"

.textmatrix(0, 4) = "結賬狀態"

do while not mrc.eof

.rows = .rows + 1

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

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

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

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

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

mrc.movenext

loop

end with

end if

end sub

機房之收取金額查詢

金額查詢涉及到日曆,vb6.0的工具欄中是沒有這個控價的,於是我們要到工程裡面找 方法如下 工程 部件 控制項 microsoft windows common controls 26.0 應用 確定 載入後的圖形顯示 思路 部分 知識點 這裡有一點感覺很重要,就是連線 查詢語句 txtsql se...

第一次機房收費系統 收取金額查詢

一 思維導圖 二 如何導圖excel 三 展示 private sub cmdinquiry click dim mrc as adodb.recordset dim txtsql as string dim msgtext as string 查詢選定範圍裡的資料 txtsql select fr...

機房收費系統 金額返回資訊查詢

msgbox 終止日期不能早於起止日期!vbokonly vbexclamation,提示 exit sub else if mrc.eof true then msgbox 沒有資料記錄!vbokonly vbexclamation,提示 exit sub end if end if with m...