Created
June 10, 2012 14:11
-
-
Save cx20/2905817 to your computer and use it in GitHub Desktop.
Hello, ADO World! (VBScript + ADO + ODBC + SQL Server)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Call Main() | |
Sub Main() | |
Dim cn | |
Dim rs | |
Set cn = CreateObject("ADODB.Connection") | |
cn.Open "PROVIDER=MSDASQL;Driver={SQL Server};" & _ | |
"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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment