Allowing backtick (`) in ALTER DATABASE PASSWORD OleDbCommand


I'm trying to update my .accdb file passwords programmatically with the OleDbCommand: ALTER DATABASE PASSWORD [newPasswordWithBacktick] [oldPasswordWithBacktick]

My code works, if there are no backticks in the password. With backticks, it throws following exception:

ERROR (:0) - Following error occurred: Fehler E_FAIL(0x80004005) in IErrorInfo.GetDescription. System.Data.OleDb.OleDbException (0x80004005): Fehler E_FAIL(0x80004005) in IErrorInfo.GetDescription. bei System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) bei System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) bei System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) bei System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) bei System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) bei System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) bei System.Data.OleDb.OleDbCommand.ExecuteReader()

The same passwords with backtick are allowed, when i open it with MS Access or in the Connectionstring. Is it possible to escape these backticks?

asked on Stack Overflow Nov 17, 2020 by chefmoudi

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0