Skip to content

Instantly share code, notes, and snippets.

@cx20
Created June 10, 2012 14:07
Show Gist options
  • Save cx20/2905799 to your computer and use it in GitHub Desktop.
Save cx20/2905799 to your computer and use it in GitHub Desktop.
Hello, DAO World! (VBScript + DAO + ACE)
Option Explicit
Call Main()
Sub Main()
Dim dbe
Dim db
Dim rs
Set dbe = CreateObject("DAO.DBEngine.120")
Set db = dbe.OpenDatabase("Hello.accdb")
Set rs = db.OpenRecordset("SELECT 'Hello, DAO 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