sol13-9.vbs
来自「Apress - Managing Enterprise Systems Wit」· VBS 代码 · 共 21 行
VBS
21 行
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 + =
减小字号Ctrl + -
显示快捷键?