DbServer Constructor (Usual, Object, Object, String, Array) | |
Construct a server object.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.19
Syntax CONSTRUCTOR(
cFile AS USUAL,
lShareMode AS Object,
lReadOnlyMode AS Object,
xDriver AS STRING,
aRDD AS ARRAY
)
public DbServer(
Usual cFile,
[DefaultParameterValueAttribute(null, 0)] Object lShareMode,
[DefaultParameterValueAttribute(null, 0)] Object lReadOnlyMode,
[DefaultParameterValueAttribute("", 0)] string xDriver,
[DefaultParameterValueAttribute(null, 0)] Array aRDD
)
Request Example
View SourceParameters
- cFile
- 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.
- lShareMode
- 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. - lReadOnlyMode
- 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. - xDriver
- Type: String
The driver can be specified. If not specified, it defaults to the driver specified by RDDSetDefault() which in turn defaults to DBFNTX. - aRDD
- 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
Type:
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.
Examples
The following examples demonstrate several different methods of constructing a DBServer object:
1
2oDBCust := DBServer{"CUSTOMER"}
3
4oDBCust := DBServer{"CUSTOMER",DBSHARED,DBREADONLY, "DBFNTX"}
5
6
7oFSCust := FileSpec{"d:\data\customer"}
8oDBCust := DBServer{oFSCust,,FALSE}
See Also