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

📄 sol13-19.vbs

📁 Apress - Managing Enterprise Systems With The Windows Script Host Source Code
💻 VBS
字号:
Set objCmd = CreateObject("ADODB.Command")
'check if script is run using Wscript or Cscript
   If StrComp(Right(Wscript.Fullname,11),"cscript.exe", vbTextCompare) <>0 Then 
Wscript.Echo "This script is best run using Cscript.exe"
    Wscript.Quit
   End If

objCmd.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ 
            "Data Source=D:\data\Access\Samples\Northwind.mdb"
objCmd.CommandText = "[Employee Sales by Country]" 'set the query

'execute the command, passing an array of parameters to it.
Set objRst = objCmd.Execute(, Array(#1/1/1996#, #12/12/1996#))

While Not objRst.EOF
Wscript.Echo objRst("ShippedDate") & " " & objRst("SaleAmount")
objRst.MoveNext
Wend

objRst.Close

⌨️ 快捷键说明

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