Const adOpenStatic = 3
Const adLockOptimistic = 3 Const adUseClient = 3 Set objConnection = CreateObject("ADODB.Connection") Set objRecordset = CreateObject("ADODB.Recordset") objConnection.Open "DRIVER={Microsoft ODBC for Oracle};UID=;PWD=" objRecordset.CursorLocation = adUseClient objRecordset.CursorType = adopenstatic objRecordset.LockType = adlockoptimistic ObjRecordset.Source = "select field1,field2 from testTable" ObjRecordset.ActiveConnection = ObjConnection ObjRecordset.Open 'This will execute your Query If ObjRecordset.recordcount>0 Then Field1 = ObjRecordset("Field1").Value Field2 = ObjRecordset("Field2").Value End IfA blog on Selenium WebDriver, Java, VB Script, Software Testing, SOAPUI, Groovy, SOA Testing, Mobile Testing, Appium etc.
Saturday, 10 August 2013
How to Search String
Functions retrieves all the instances of the searched string and returns the number of instances detected, also a reference array will give you ‘additional information about the locations of the searched string. This is done using Instr and Chr function.
Public Function InStrAll( _
ByVal nStart, ByVal sString1, ByVal sString2, _
ByVal nCompare, ByRef arrRes)
Dim nBookMark, nFound, nCount
Dim i
nCount = 0 : nBookMark = nStart
Do
‘— searching the position found.
nFound = InStr(nBookMark, sString1, sString2, nCompare)
ByVal nStart, ByVal sString1, ByVal sString2, _
ByVal nCompare, ByRef arrRes)
Dim nBookMark, nFound, nCount
Dim i
nCount = 0 : nBookMark = nStart
Do
‘— searching the position found.
nFound = InStr(nBookMark, sString1, sString2, nCompare)
If nFound > 0 Then
nCount = nCount + 1
‘— resizing the array with preserve to store new location
ReDim Preserve arrRes(nCount – 1)
arrRes(nCount – 1) = nFound
‘— setting the next start point to search
nBookMark = nFound + 1
End If
nCount = nCount + 1
‘— resizing the array with preserve to store new location
ReDim Preserve arrRes(nCount – 1)
arrRes(nCount – 1) = nFound
‘— setting the next start point to search
nBookMark = nFound + 1
End If
Loop While nFound > 0
InStrAll = nCount
End Function
End Function
What is Processes
Process is kind of program or task carried out by your PC. For e.g.
$ ls -lR
ls command or a request to list files in a directory and all subdirectory in your current directory – It is a
process. Process defined as:
process. Process defined as:
“A process is program (command given by user) to perform specific Job. In Linux when you start
process, it gives a number to process (called PID or process-id), PID starts from 0 to 65535.”
process, it gives a number to process (called PID or process-id), PID starts from 0 to 65535.”
What is Shell Script
Shells are interactive. It means shell accept command from you (via keyboard) and execute
them. But if you use command one by one (sequence of ‘n’ number of commands) , the you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands. This is know as shell script.
them. But if you use command one by one (sequence of ‘n’ number of commands) , the you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands. This is know as shell script.
Shell script defined as:
“Shell Script is series of command written in plain text file. Shell script is just like batch file is MS-DOS but have more power than the MS-DOS batch file.”
“Shell Script is series of command written in plain text file. Shell script is just like batch file is MS-DOS but have more power than the MS-DOS batch file.”
Subscribe to:
Comments (Atom)
• Measure response times
• Repeat tests in a consistent way
• Compare results