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

📄 sol13-9.vbs

📁 Apress - Managing Enterprise Systems With The Windows Script Host Source Code
💻 VBS
字号:
Dim objConn, objRst, objNetwork, strDay
'get the current name of day e.g. Monday
strDay = WeekDayName(Weekday(Date))
Set objNetwork = CreateObject("WScript.Network")
Set objConn = CreateObject("ADODB.Connection")

'open a connection using the ExcelUserData file DSN
objConn.Open "FileDSN=E:\Code Download\Chapter 13\ExcelUserData.dsn"

'get the record for todays date for the current user 
    Set objRst = objConn.Execute("Select " & strDay & _ 
       " From UserList Where UserID='" & objNetwork.UserName & "'")
    'check if the time column for the current day. If it is empty, then 
    'update the time.
    If IsNull(objRst(strDay).Value) Then
        objConn.Execute "UPDATE UserList Set " & strDay & "='" & Time & _ 
           "' Where UserID='" & objNetwork.UserName & "'"
    End If
objRst.Close
objConn.Close

⌨️ 快捷键说明

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