Class AccessConnectionProvider
- Namespace
- DevExpress.Xpo.DB
- Assembly
- DevExpress.Xpo.v24.1.dll
Implements data-aware operations for working with Microsoft Access databases.
public class AccessConnectionProvider : OleDBConnectionProvider, ISqlGeneratorFormatterEx, ISqlGeneratorFormatter
- Inheritance
-
AccessConnectionProvider
- Implements
-
ISqlGeneratorFormatterExISqlGeneratorFormatter
- Inherited Members
Constructors
AccessConnectionProvider(IDbConnection, AutoCreateOption)
Initializes a new instance of the AccessConnectionProvider class with the specified settings.
public AccessConnectionProvider(IDbConnection connection, AutoCreateOption autoCreateOption)
Parameters
connection
IDbConnectionAn object implementing the IDbConnection interface that represents an open connection to a data source.
autoCreateOption
AutoCreateOptionAn DevExpress.Xpo.DB.AutoCreateOption value that specifies which operations should be performed when storage is accessed for the first time. This parameter is used to initialize the IDataStore.AutoCreateOption property.
Fields
MaximumStringSize
This member supports the internal infrastructure and is not intended to be used directly from your code.
public const int MaximumStringSize = 255
Field Value
XpoProviderTypeString
Gets the name of the current connection provider. This name is used internally when generating a connection string via the AccessConnectionProvider.GetConnectionString method.
public const string XpoProviderTypeString = "MSAccess"
Field Value
Properties
DbTypeMapper
protected override DbTypeMapperBase DbTypeMapper { get; }
Property Value
- DbTypeMapperBase
NeedsIndexForForeignKey
protected override bool NeedsIndexForForeignKey { get; }
Property Value
Methods
CommandBuilderDeriveParameters(IDbCommand)
protected override void CommandBuilderDeriveParameters(IDbCommand command)
Parameters
command
IDbCommand
ConvertToDbParameter(object, TypeCode)
protected override object ConvertToDbParameter(object clientValue, TypeCode clientValueTypeCode)
Parameters
Returns
CreateCommand(Query)
protected override IDbCommand CreateCommand(Query query)
Parameters
query
Query
Returns
CreateConnection()
protected override IDbConnection CreateConnection()
Returns
CreateDataBase()
protected override void CreateDataBase()
CreateForeignKey(DBTable, DBForeignKey)
Creates a foreign key.
public override void CreateForeignKey(DBTable table, DBForeignKey foreignKey)
Parameters
table
DBTableA DevExpress.Xpo.DB.DBTable object that represents the table.
foreignKey
DBForeignKeyA DevExpress.Xpo.DB.DBForeignKey object that represents the foreign key.
CreateProviderFromConnection(IDbConnection, AutoCreateOption)
This method supports the internal infrastructure and is not intended to be called directly from your code.
public static IDataStore CreateProviderFromConnection(IDbConnection connection, AutoCreateOption autoCreateOption)
Parameters
connection
IDbConnectionautoCreateOption
AutoCreateOption
Returns
- IDataStore
CreateProviderFromString(string, AutoCreateOption, out IDisposable[])
This method supports the internal infrastructure and is not intended to be called directly from your code.
public static IDataStore CreateProviderFromString(string connectionString, AutoCreateOption autoCreateOption, out IDisposable[] objectsToDisposeOnDisconnect)
Parameters
connectionString
stringautoCreateOption
AutoCreateOptionobjectsToDisposeOnDisconnect
IDisposable[]
Returns
- IDataStore
ExecuteSproc(string, params OperandValue[])
protected override SelectedData ExecuteSproc(string sprocName, params OperandValue[] parameters)
Parameters
sprocName
stringparameters
OperandValue[]
Returns
- SelectedData
ExecuteSprocAsync(AsyncOperationIdentifier, CancellationToken, string, params OperandValue[])
protected override Task<SelectedData> ExecuteSprocAsync(AsyncOperationIdentifier asyncOperationId, CancellationToken cancellationToken, string sprocName, params OperandValue[] parameters)
Parameters
asyncOperationId
AsyncOperationIdentifiercancellationToken
CancellationTokensprocName
stringparameters
OperandValue[]
Returns
- Task<SelectedData>
FormatBinary(BinaryOperatorType, string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatBinary(BinaryOperatorType operatorType, string leftOperand, string rightOperand)
Parameters
Returns
FormatColumn(string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatColumn(string columnName)
Parameters
columnName
string
Returns
FormatColumn(string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatColumn(string columnName, string tableAlias)
Parameters
Returns
FormatConstraint(string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatConstraint(string constraintName)
Parameters
constraintName
string
Returns
FormatDelete(string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatDelete(string tableName, string whereClause)
Parameters
Returns
FormatFunction(FunctionOperatorType, params string[])
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatFunction(FunctionOperatorType operatorType, params string[] operands)
Parameters
operatorType
FunctionOperatorTypeoperands
string[]
Returns
FormatFunction(ProcessParameter, FunctionOperatorType, params object[])
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatFunction(ProcessParameter processParameter, FunctionOperatorType operatorType, params object[] operands)
Parameters
processParameter
ProcessParameteroperatorType
FunctionOperatorTypeoperands
object[]
Returns
FormatInsert(string, string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatInsert(string tableName, string fields, string values)
Parameters
Returns
FormatInsertDefaultValues(string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatInsertDefaultValues(string tableName)
Parameters
tableName
string
Returns
FormatSelect(string, string, string, string, string, string, int)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatSelect(string selectedPropertiesSql, string fromSql, string whereSql, string orderBySql, string groupBySql, string havingSql, int topSelectedRecords)
Parameters
selectedPropertiesSql
stringfromSql
stringwhereSql
stringorderBySql
stringgroupBySql
stringhavingSql
stringtopSelectedRecords
int
Returns
FormatTable(string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatTable(string schema, string tableName)
Parameters
Returns
FormatTable(string, string, string)
This member supports the internal infrastructure and is not intended be used directly from your code.
public override string FormatTable(string schema, string tableName, string tableAlias)
Parameters
Returns
FormatUpdate(string, string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatUpdate(string tableName, string sets, string whereClause)
Parameters
Returns
GetConnectionString(string)
Returns a connection string to the specified Microsoft Access data base using the default credentials.
public static string GetConnectionString(string database)
Parameters
database
stringA string that specifies the path and name of the data base to connect to.
Returns
- string
A connection string.
GetConnectionString(string, string, string)
Returns a connection string to the specified Microsoft Access database using the specified credentials.
public static string GetConnectionString(string database, string userId, string password)
Parameters
database
stringA string that specifies the path and name of the database to connect to.
userId
stringA string that specifies the user’s name. This is used to initialize the “User ID” field of the connection string.
password
stringA string that specifies the password. This is used to initialize the “Password” field of the connection string.
Returns
- string
A connection string.
GetConnectionStringACE(string, string)
Returns a connection string to the specified Microsoft Access 2007 database using the default credentials.
public static string GetConnectionStringACE(string database, string password)
Parameters
database
stringA string that specifies the path and name of the data base to connect to.
password
stringA string that specifies the password. This is used to initialize the “Password” field of the connection string.
Returns
- string
A connection string.
GetIdentity(Query)
protected override long GetIdentity(Query sql)
Parameters
sql
Query
Returns
GetIdentityAsync(Query, AsyncOperationIdentifier, CancellationToken)
protected override Task<long> GetIdentityAsync(Query sql, AsyncOperationIdentifier asyncOperationId, CancellationToken cancellationToken)
Parameters
sql
QueryasyncOperationId
AsyncOperationIdentifiercancellationToken
CancellationToken
Returns
GetParameterName(OperandValue, int, ref bool)
This member supports the .NET Framework infrastructure and cannot be used directly from your code.
public override string GetParameterName(OperandValue parameter, int index, ref bool createParameter)
Parameters
Returns
GetSafeNameRoot(string)
protected override string GetSafeNameRoot(string originalName)
Parameters
originalName
string
Returns
GetSafeNameTableMaxLength()
protected override int GetSafeNameTableMaxLength()
Returns
GetSqlCreateColumnFullAttributes(DBTable, DBColumn)
This method supports the internal infrastructure and is not intended to be used directly from your code.
public override string GetSqlCreateColumnFullAttributes(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnFullAttributes(DBTable, DBColumn, bool)
public override string GetSqlCreateColumnFullAttributes(DBTable table, DBColumn column, bool forTableCreate)
Parameters
table
DBTablecolumn
DBColumnforTableCreate
bool
Returns
GetSqlCreateColumnTypeForBoolean(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForBoolean(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForByte(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForByte(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForByteArray(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForByteArray(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForChar(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForChar(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForDateTime(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForDateTime(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForDecimal(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForDecimal(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForDouble(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForDouble(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForGuid(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForGuid(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForInt16(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForInt16(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForInt32(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForInt32(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForInt64(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForInt64(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForSByte(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForSByte(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForSingle(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForSingle(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForString(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForString(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForUInt16(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForUInt16(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForUInt32(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForUInt32(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForUInt64(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForUInt64(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetStorageTablesList(bool)
Returns a list of the available tables in the data store.
public override string[] GetStorageTablesList(bool includeViews)
Parameters
includeViews
booltrue, to include available database views in the resulting array; otherwise, false.
Returns
- string[]
An array which contains the table names in the data store.
GetStoredProcedures()
Returns an array of stored procedures available within the data store.
public override DBStoredProcedure[] GetStoredProcedures()
Returns
- DBStoredProcedure[]
An array containing available stored procedures.
ProcessClearDatabase()
protected override void ProcessClearDatabase()
Register()
Registers the provider for use with XPO.
public static void Register()
WrapException(Exception, IDbCommand)
protected override Exception WrapException(Exception e, IDbCommand query)
Parameters
e
Exceptionquery
IDbCommand