Xbasic

SQL::ConnectionGenerateGrantAccessStatement Method

Syntax

SQL_Statement as C = GenerateGrantAccessStatement as C (User as C, Resource as C, AccessType as C)

Arguments

UserCharacter

The user that will receive the new permission.

ResourceCharacter

A database table or view.

AccessTypeCharacter

The type of permission to set.

Returns

SQL_StatementCharacter

Returns a SQL statement that gives a user permissions to add resources in a database.

Description

Generate a SQL Grant Access statement.

Discussion

The .GenerateGrantAccessStatement() method gives a user a permission to a resource in a database.

Example

dim conn as SQL::Connection
conn.open("{A5API=Access,FileName='C:\Program Files\A5V8\MDBFiles\Alphasports.mdb',UserName='Admin'}")
? conn.GenerateGrantAccessStatement("Tom", "Customer", "Read")
= "GRANT Read ON Customer TO Tom"

See Also