hasokeric
1/28/2017 - 8:53 PM

oledb.vbs

Option Explicit
 
Call Main()
 
Sub Main()
    Dim cn
    Dim rs
 
    Set cn = CreateObject("ADODB.Connection")
    cn.Open "PROVIDER=SQLOLEDB;" & _
         "SERVER=(local);DATABASE=master;", _
         "sa", "P@ssW0rd"
    Set rs = cn.Execute("SELECT 'Hello, ADO World!' AS Message")
 
    While Not rs.EOF
        WScript.Echo rs(0).Name
        WScript.Echo "-------------------"
        WScript.Echo rs(0).Value
        rs.MoveNext
    Wend
End Sub