bump product version to 5.0.4.1
[LibreOffice.git] / basic / qa / vba_tests / ole_ObjAssignToNothing.vb
blobb34163db73cee4fbe11cf0698ce4a8fbde7189e9
1 Option VBASupport 1
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
6 Rem keyword
7 Set cn = New ADODB.Connection
8 Dim conStr As String
9 conStr = "Provider=MSDASQL;Driver={Microsoft Excel Driver (*.xls)};DBQ="
10 conStr = conStr & TestData & "; ReadOnly=False;"
11 cn.Open conStr
12 Set objCmd = New ADODB.Command
13 objCmd.ActiveConnection = Nothing
14 if objCmd.ActiveConnection Is Nothing Then
15 doUnitTest = "OK" ' no error
16 Else
17 doUnitTest = "Fail - expected objCmd.ActiveConnection be Nothing"
18 End If
19 End Function