Switch to: V12V11V10V9V8V7V6V5

VCursor Class: Construction Methods

VCursor.VCursor()

Declaration:

VCursor(	
	inDatabase as VDatabase, 
	inQuery as String, 
	inCursorLocation as EVCursorLocation = kClientSide, 
	inLockType as EVLockType = kReadOnly,  
	inCursorDirection as EVCursorDirection = kForwardOnly )

Parameters:

  • inDatabase - The reference to VDataBase object.
  • inQuery - The query string.
  • inCursorLocation - The location of the cursor.
  • inLocksType - The type of record locks.
  • inCursorDirection - The cursor direction.

Description:

This constructor provides you with the second way to create a Cursor. The first primary way is to use the method VDatabase.SQLSelect().

You may prefer this second way to be able to define a subclass of VCursor. This constructor in fact just calls VDatabase.SqlSelect().

The constructor is given a string, as parameter inQuery, resolves it, and keeps a result.

Note: When finished with a cursor, you should assign it to nil to destroy it and free memory.

The optional parameters inCursorLocation, inLockType, inCursorDirection allow you to control the behavior of the cursor. See the documentation on Valentina Kernel.and VServer for more details.

You can set the following parameters with these values:

  • inCursorLocation:
    • kClientSide = 1
    • kServerSide = 2
    • kServerSideBulk = 3
  • inLockType:
    • kNoLocks = 1
    • kReadOnly = 2
    • kReadWrite = 3
  • inCursorDirection:
    • kForwardOnly = 1
    • kRandom = 2

By default these parameters get the following values: { kClientSide, kReadOnly, kForwardOnly }.

Example:

Sub myCursor( inDB as VDataBase, inSQL as String )
	VCursor(inDB, inSQL)	// init parent class.
	...
end sub

This assumes that you want to create the myCursor class, which is a subclass of VCursor.