Page 1 of 1

Access database.

Posted: Sun 17 Sep 2017 19:38
by prauss
I try to change a password for an existing access database but there are problems with it.
At first I tried to use command ALTER database .... but there was a problem with not recognisation of SQL syntax text (there appeared a message, saying that I can use only following commands : DELETE, INSERT, PROCEDURE, SELECT and UPDATE).

Then I find out, that in order to change password I have to have ExclusiveLock rights. I found such possibility in UniConnection>SpecificOptions>SpecificLock> and I changed this property to "True". But in this case my application hangs running out or there appeared a message, saying that there is wrong password, ... but I know, it is ok.

Which is the best and easiest way to change password for an existing access database (using UNIdac).

Thanks for ane suggestions.

Re: Access database.

Posted: Tue 19 Sep 2017 07:36
by MaximG
To use the SQL query "ALTER DATABASE PASSWORD ...", when working with Microsoft Access DB using UniDAC, you should use the 'ExtendedAnsiSQL' option :

Code: Select all

  ...
  UniConnection.SpecificOptions.Values['ExtendedAnsiSQL'] := 'True';
  UniConnection.SpecificOptions.Values['ExclusiveLock'] := 'True';
  UniConnection.Password := 'currentpassword';
  UniConnection.Connect;
  UniConnection.ExecSQL('ALTER DATABASE PASSWORD newpassword currentpassword');
  ...

Re: Access database.

Posted: Sun 24 Sep 2017 15:42
by prauss
Thanx, it works .. :D
MaximG wrote:To use the SQL query "ALTER DATABASE PASSWORD ...", when working with Microsoft Access DB using UniDAC, you should use the 'ExtendedAnsiSQL' option :

Code: Select all

  ...
  UniConnection.SpecificOptions.Values['ExtendedAnsiSQL'] := 'True';
  UniConnection.SpecificOptions.Values['ExclusiveLock'] := 'True';
  UniConnection.Password := 'currentpassword';
  UniConnection.Connect;
  UniConnection.ExecSQL('ALTER DATABASE PASSWORD newpassword currentpassword');
  ...

Re: Access database.

Posted: Mon 25 Sep 2017 08:15
by MaximG
We are glad to see the problem resolved. Please don't hesitate to contact us with questions concerning UniDAC usage.