Click or drag to resize

DbServer Constructor (Usual, Object, Object, String, Array)

Construct a server object.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.18
	cFile AS USUAL,
	 lShareMode AS Object,
	 lReadOnlyMode AS Object,
	 xDriver AS STRING,
Request Example View Source


Type: Usual
The name of the file to open
This parameter identifies the DBF file that is to be opened. If a string is specified, it corresponds exactly to the file name parameter of the DBUseArea() function; it can contain a full path with drive and directories, or just a file name. If a FileSpec object is specified, its file name component is used as the file to open. It can also contain a full path with drive and directories, or just a file name. With either type of parameter, if only a file name is specified, the DBServer works the same way as the USE command or the DBUseArea() function with regard to default path—it is subject to SET PATH and SET DEFAULT, for example. The extension DBF is assumed by default. In either case, after the DBServer object has been successfully created, it contains a FileSpec object with the original file specification.
Type: Object
Identifies whether the file should be opened in shared mode. Can be specified as a constant, DBSHARED (TRUE) or DBEXCLUSIVE (FALSE). If not specified, the default is determined by the SetExclusive() function, which in turn defaults to 'exclusive' or FALSE.
Type: Object
Identifies whether the file should be opened in read only mode. Can be specified as a constant, DBREADONLY (TRUE) DBREADWRITE (FALSE). If not specified, it defaults to read-write or FALSE.
Type: String
The driver can be specified. If not specified, it defaults to the driver specified by RDDSetDefault() which in turn defaults to DBFNTX.
Type: Array
A one-dimensional array with the names of RDDs from which the main RDD inherits special functionality. This allows you to use RDDs with special capabilities, like encryption or decryption, for different data servers with different database drivers. These RDDs overlay special functions of the main RDD (specified with the cDriver argument). If multiple RDDs (specified with this argument) implement the same function, the function associated with the last RDD in the list takes precedence. If aRdds is omitted, no additional RDDs are assumed.

Return Value

As with all Init() methods, the instantiation returns the object. An object is created even if the file was not successfully opened, perhaps because the file does not exist, is corrupted or is locked by another user. Thus, before using the DBServer error, verify that it was successfully opened with the DBServer:Used or Status access methods.
The following examples demonstrate several different methods of constructing a DBServer object:
1// Specify only the DBF file
2oDBCust := DBServer{"CUSTOMER"}
3// Specify all four parameters
5// Use a FileSpec object specification to define the
6// DBF file to open (in "exclusive", read-write mode)
7oFSCust := FileSpec{"d:\data\customer"}
8oDBCust := DBServer{oFSCust,,FALSE}
See Also