DdfSetOwner
Applies to
VAccess
Description
Can be used to set the Btrieve owner name for the dictionary files to something other than the default owner name and security level (allow read-only access). Owner name and security level parameters follow Btrieve conventions.
Syntax
object
.
DdfSetOwner
(
NewOwnerName
,
SecurityLevel
)
The syntax for this method has the following parts:
Part
Description
object
Required. The object placeholder represents an object expression that evaluates to an object in the Applies To list.
newOwnerName
a string to assign an owner name to the table
SecurityLevel
integer representing a security level
Remarks
The following Security Level codes may be passed to
DdfSetOwner
in the
SecurityLevel
parameter:
Code
Global Constant
Description
0
EXCLUSIVE
Does not allow the file to be opened unless the correct owner name is specified.
1
READONLY
Permits users who do not specify an owner name to view, but not to modify the table.
2
EXCLUSIVE_ENCRYPT
Does not allow the file to be opened unless the correct owner name is specified. Data is encrypted within the file.
3
READONLY_ENCRYPT
Permits users who do not specify an owner name to view, but not to modify the table. Data is encrypted within the file.
Constant declarations are included in the files GLOBAL.BAS (for 16 bit Visual Basic), GLOBAL.BAS (for Visual Basic), GLOBAL.PAS (for Delphi), and GLOBAL.H (for Visual C++). Include one of these files (whichever is appropriate for your development environment) in your project to use the Security Level constants in your application.
Example
Private Function SetDDFOwner(newOwner as String, _
securityLevel as Integer) as Integer
'We must have confirmation to continue
VAEngine.RefreshLocations = True
'write this to 'DDF's
status = VAEngine.DdfSetOwner(newOwner, _
securityLevel)
If status = 0 Then
msg = "DDF Password has been successfully" _
& " changed."
MsgBox msg, vbInformation
Else
msg = " Btrieve returned status " + _
CStr(status) + "."
MsgBox msg, vbExclamation
End If
End Function