Re: Assign username/password to access file



On Tue, 09 Oct 2007 04:00:32 +0100, Brian Bushay TeamB <BBushay@xxxxxxxxx> wrote:

If I want to assign a username and a password to an existing accessfile, how
do I do this? Please code sample....

Neither of these can be set with ADO.


On Access 2002 with ADO, a simple "Execute_SQL"...

AdoConnection.Execute (
'alter database PASSWORD [' + NewDatabasePassword + ']'
+ ' [' + OldDatabasePassword + ']',
RecordsAffected, [eoExecuteNoRecords] )
.... works for me!

And unlike JRO's "CompactDatabase" this doesn't require the copy of a (possibly large) database. But, of course, you might find the compaction to be of benefit.

The square brackets round the [Passwords] are in case any of the passwords contain "strange" characters, such as embedded spaces, etc.

--
Paul Scott
Information Management Systems
Macclesfield, UK.
.



Relevant Pages