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

📄 sol13-8.vbs

📁 Apress - Managing Enterprise Systems With The Windows Script Host Source Code
💻 VBS
字号:
Dim objConn, objRst, nTotal
Set objConn = CreateObject("ADODB.Connection")
'open a connection to a text file using a DSN
'the ODBC DSN is defined in Solution 13-1.
objConn.Open "SalesCSV"
'select all data from the text file Orders data.txt
Set objRst = objConn.Execute("Select * From [Orders data.txt]")

'loop through and total the contents
While Not objRst.EOF
    nTotal = nTotal + objRst("SalesTotal").Value
    objRst.MoveNext
Wend

Wscript.Echo "Total sales is:" & nTotal
'close the connection and recordset object
objRst.Close
objConn.Close

⌨️ 快捷键说明

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