Files
libreoffice/basic/qa/vba_tests/ole_ObjAssignToNothing.vb
Noel Power 0f7798d862 unit tests and data for bnc#805071
Change-Id: I36fefa280ee922cbade676c951b753e632c9d8bb
2013-03-11 17:32:53 +00:00

20 lines
654 B
VB.net

Option VBASupport 1
Function doUnitTest( TestData 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={Microsoft Excel Driver (*.xls)};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