⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 functionmodel.bas

📁 农村水电费记帐录入
💻 BAS
字号:
Attribute VB_Name = "Module1"
'Public Sub Main()
'frmSplash.Show
'
'
'frmlogin.Show 1
'MDIme.Show
'End Sub
 Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Option Explicit

Public Function GetpcHard(ByRef getid As String) As String
    Dim DiskModel(31) As Byte, DiskID(31) As Byte, i As Integer, Model As String, id As String
    If DiskID32(DiskModel(0), DiskID(0)) <> 1 Then
    
        GetpcHard = "get diskid32 err"
        Exit Function
    End If
    For i = 0 To 31
        If Chr(DiskModel(i)) <> Chr(0) Then
            Model = Model & Chr(DiskModel(i))
        End If
        If Chr(DiskID(i)) <> Chr(0) Then
            id = id & Chr(DiskID(i))
        End If
    Next
    GetpcHard = Model '硬件产生代码为:"
    getid = id '"硬盘序列号为:" +
End Function


Public Sub initAdo(rst As ADODB.Recordset)
On Error GoTo errH:
If rst.State = 1 Then
  rst.Close
End If
Set rst.ActiveConnection = gCnn
rst.CursorLocation = adUseClient
rst.CursorType = adOpenKeyset
rst.LockType = adLockBatchOptimistic
Exit Sub
errH:
MsgBox "程序可能无法继续正确运行, 因为initAdo函数出现以下错误:" & err.Description
End Sub

Public Function bymonth(mm As String) As String
If Len(Trim(mm)) <> 4 Then
    bymonth = ""
    Exit Function
End If

bymonth = "SELECT 用户编号, 姓名, ISNULL(欠款, 0) AS 应交金额,上月欠费, " & _
     " 本月电量 AS 用电量, ISNULL(本月电费, 0) AS 电费, ISNULL(本月水费, 0) " & _
      " AS 水费,  ISNULL(本月水电费, 0) AS 水电费, selcol FROM f_sdfcount('" & Trim(mm) & "') a "

End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -