AdsSQLServer Constructor | |
Construct a server object.
Namespace:
VO
Assembly:
VORDDClasses (in VORDDClasses.dll) Version: 2.21
Syntax CONSTRUCTOR(
oFile,
lShareMode,
lReadOnlyMode,
xDriver,
aRDD,
aParams
) CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public AdsSQLServer(
Usual oFile = default,
Usual lShareMode = default,
Usual lReadOnlyMode = default,
Usual xDriver = default,
Usual aRDD = default,
Usual aParams = default
)
Request Example
View SourceParameters
- oFile (Optional)
- Type: Usual
A String or a FileSpec object with 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 (Optional)
- Type: Usual
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 (Optional)
- Type: Usual
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 (Optional)
- Type: Usual
The driver can be specified. If not specified, it defaults to the driver specified by RDDSetDefault() which in turn defaults to DBFNTX. - aRDD (Optional)
- Type: Usual
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.
- aParams (Optional)
- Type: Usual
Optional array of parameter values
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