diff options
Diffstat (limited to 'basic/qa/vba_tests/ole_ObjAssignToNothing.vb')
-rw-r--r-- | basic/qa/vba_tests/ole_ObjAssignToNothing.vb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/basic/qa/vba_tests/ole_ObjAssignToNothing.vb b/basic/qa/vba_tests/ole_ObjAssignToNothing.vb new file mode 100644 index 000000000..d68664b41 --- /dev/null +++ b/basic/qa/vba_tests/ole_ObjAssignToNothing.vb @@ -0,0 +1,19 @@ +Option VBASupport 1 +Function doUnitTest(TestData as String, Driver as String) as String +Rem Ensure object assignment is by reference +Rem when object member is used ( as lhs ) +Rem This time we are testing assigning with special Nothing +Rem keyword +Set cn = New ADODB.Connection +Dim conStr As String +conStr = "Provider=MSDASQL;Driver={" & Driver & "};DBQ=" +conStr = conStr & TestData & "; ReadOnly=False;" +cn.Open conStr +Set objCmd = New ADODB.Command +objCmd.ActiveConnection = Nothing +if objCmd.ActiveConnection Is Nothing Then + doUnitTest = "OK" ' no error +Else + doUnitTest = "Fail - expected objCmd.ActiveConnection be Nothing" +End If +End Function |