Skip to content

Instantly share code, notes, and snippets.

@cx20
cx20 / Hello.vbs
Created June 10, 2012 14:11
Hello, ADO World! (VBScript + ADO + ODBC + SQL Server)
Option Explicit
Call Main()
Sub Main()
Dim cn
Dim rs
Set cn = CreateObject("ADODB.Connection")
cn.Open "PROVIDER=MSDASQL;Driver={SQL Server};" & _
@cx20
cx20 / Hello.vbs
Created June 10, 2012 14:10
Hello, ADO World! (VBScript + ADO + OLEDB + SQL Server)
Option Explicit
Call Main()
Sub Main()
Dim cn
Dim rs
Set cn = CreateObject("ADODB.Connection")
cn.Open "PROVIDER=SQLOLEDB;" & _
@cx20
cx20 / Hello.vbs
Created June 10, 2012 14:08
Hello, DAO World! (VBScript + DAO + ODBC)
Option Explicit
Call Main()
Sub Main()
Dim dbe
Dim db
Dim rs
Set dbe = CreateObject("DAO.DBEngine.36")
@cx20
cx20 / Hello.vbs
Created June 10, 2012 14:07
Hello, DAO World! (VBScript + DAO + ACE)
Option Explicit
Call Main()
Sub Main()
Dim dbe
Dim db
Dim rs
Set dbe = CreateObject("DAO.DBEngine.120")
@cx20
cx20 / Hello.vbs
Created June 10, 2012 14:06
Hello, DAO World! (VBScript + DAO + Jet)
Option Explicit
Call Main()
Sub Main()
Dim dbe
Dim db
Dim rs
Set dbe = CreateObject("DAO.DBEngine.36")
@cx20
cx20 / hello.c
Created June 10, 2012 14:04
Hello, ODBC(API) World!
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <sqlext.h>
#include <sql.h>
int _tmain( int argc, TCHAR* argv[] )
{
HENV henv;
HDBC hdbc;
@cx20
cx20 / hello.sqc
Created June 10, 2012 14:03
Hello, ESQL/C World!
#include <stdio.h>
int main( int argc, char* argv[] )
{
EXEC SQL BEGIN DECLARE SECTION;
char szServerDatabase[] = "(local).pubs";
char szLoginPassword[] = "sa.P@ssW0rd";
char szCommand[] = "SELECT 'Hello, ESQL/C World!' AS Message";
char message[32] = { 0 };
EXEC SQL END DECLARE SECTION;
@cx20
cx20 / hello.c
Created June 10, 2012 14:01
Hello, DB-Library World!
#define DBNTWIN32
#include "windows.h"
#include <sqlfront.h>
#include <sqldb.h>
#include <stdio.h>
int main( int argc, char* argv[] )
{
DBPROCESS* dbproc;
@cx20
cx20 / hello.js
Created June 10, 2012 14:00
Hello, MongoDB World!
db.hello.insert( { message: 'Hello, MongoDB World!' } );
var cur = db.hello.findOne();
print( cur.message );
@cx20
cx20 / hello.sql
Created June 10, 2012 13:58
Hello, Derby World!
SELECT 'Hello, Derby World!' AS Message FROM SYSIBM.SYSDUMMY1;