File: ole_dfltObjDflMethod.vb

package info (click to toggle)
libreoffice 1%3A4.3.3-2%2Bdeb8u7~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 2,687,712 kB
  • sloc: cpp: 4,024,069; java: 364,016; xml: 216,714; ansic: 74,602; perl: 34,443; python: 30,231; yacc: 12,179; makefile: 8,973; objc: 8,923; sh: 8,742; cs: 6,594; lex: 2,218; asm: 1,472; pascal: 925; awk: 807; php: 104; csh: 40; sed: 5
file content (24 lines) | stat: -rw-r--r-- 698 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Option VBASupport 1
Option Explicit

Rem Test accessing an object that has default object member
Rem which in turn has a default member that is a method
Function doUnitTest(TestData As String) As String
doUnitTest = "Begin"
Dim modifiedTimout As Long
Dim cnn1 As New ADODB.Connection
Dim rst1 As New ADODB.Recordset
Dim conStr As String
cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & TestData & ";" & _
"Extended Properties=""Excel 8.0;HDR=Yes"";"
rst1.Open "SELECT * FROM [Sheet1$];", cnn1, adOpenStatic, adLockReadOnly
Dim val
val = rst1("FirstName")
If val = "Paddy" Then
    doUnitTest = "OK"
Else
    doUnitTest = "Failed, expected 'Paddy' got " & val
End If

End Function