1Option VBASupport 1
2Function doUnitTest(TestData as String, Driver as String) as String
3Rem Ensure object assignment is by reference
4Rem when object member is used ( as lhs )
5Rem This time we are testing assigning with special Nothing
6Rem keyword
7Set cn = New ADODB.Connection
8Dim conStr As String
9conStr = "Provider=MSDASQL;Driver={" & Driver & "};DBQ="
10conStr = conStr & TestData & "; ReadOnly=False;"
11cn.Open conStr
12Set objCmd = New ADODB.Command
13objCmd.ActiveConnection = Nothing
14if objCmd.ActiveConnection Is Nothing Then
15    doUnitTest = "OK" ' no error
16Else
17    doUnitTest = "Fail - expected objCmd.ActiveConnection be Nothing"
18End If
19End Function
20