2 Function doUnitTest( TestData
as String) as String
3 Rem Ensure object assignment is by reference
4 Rem when object member is used ( as lhs )
5 Rem This time we are testing assigning with special Nothing
7 Set cn
= New ADODB
.Connection
9 conStr
= "Provider=MSDASQL;Driver={Microsoft Excel Driver (*.xls)};DBQ="
10 conStr
= conStr
& TestData
& "; ReadOnly=False;"
12 Set objCmd
= New ADODB
.Command
13 objCmd
.ActiveConnection
= Nothing
14 if objCmd
.ActiveConnection Is
Nothing Then
15 doUnitTest
= "OK" ' no error
17 doUnitTest
= "Fail - expected objCmd.ActiveConnection be Nothing"