Google+ Pieces o' Eight: April 2012

Sunday 22 April 2012

Captain Morgane and the Golden Turtle (PC Review)

Introduction

I'm a big fan of point-and-click adventures and have been ever since I first played the original Monkey Island some 20+ years ago. Sadly the genre is no longer a mainstay of video gaming, with new releases few and far between, so when I heard about Captain Morgane and the Golden Turtle - a new piratically themed point-and-click adventure - I immediately rushed out to buy it.

What follows is my (admittedly amateur) review of the PC version. Read on, me hearties, to see how she fared!



Wednesday 18 April 2012

Using VB6/VBScript to connect to a SQL Server 2012 LocalDB instance

In a previous post I covered how to use Python to connect to a SQL Server 2012 LocalDB instance. In this post I'll show you how to connect via VB6/VBScript. As per the Python post, you'll need to download and install the SQL Server 2012 LocalDb software, along with the SQL Server Native Client 11 database driver. 

One of the key differences - and one that took me some time to figure out - is that you need to specify a slightly different connection string: 

connectionString = "Provider=SQLNCLI11;Data Source=(localdb)\v11.0;Integrated Security=SSPI;"


One of the gotchas I encountered was with the Integrated Security parameter. If this isn't set to SSPI, you'll get Multiple-Step OLE DB Operation Errors.

Here's a complete listing you should be able to copy into a VBScript file to test:

connectionString = "Provider=SQLNCLI11;Data Source=(localdb)\v11.0;Integrated Security=SSPI;"
Set conn = CreateObject("ADODB.Connection")
Set com = CreateObject("ADODB.Command")
conn.Open connectionString
set com.ActiveConnection = conn
com.CommandText = "SELECT 'Hello, World!'"
set rs = com.Execute
while not rs.eof
    msgbox CStr(rs.Fields(0))
    rs.movenext()
wend
conn.close