Newsgroups: microsoft.public.in.csharp
From: "Zuzar Ladkawala" <zu...@rediffmail.com>
Date: Mon, 25 Nov 2002 08:48:46 +0530
Local: Sun, Nov 24 2002 10:18 pm
Subject: Re: mdb Password
Hi Jassim,
I am unaware if u can check if the password exists in the Access DB or not but, you can programmatically set, change, or remove a database password by using the ALTER DATABASE keyword with the following syntax: ALTER DATABASE PASSWORD NewPassword OldPassword. Kindly Go through the code below which has 2 methods , the 1st one will change the password of ur access DB and the 2nd one will change ur existing password: 1) Private Function CreateDBPassword(ByVal Password As String, _ ' Open the unsecured database. ' Execute the SQL statement to secure the database. ' Clean up objects. ' Return true if successful. CreateDBPassword_Err: 2) Private Function ChangeDBPassword(ByVal OldPassword As String, _ On Error GoTo ChangeDBPassword_Err ' Create the SQL string to change the database password. ' Open the secured database. ' Execute the SQL statement to change the password. ' Clean up objects. ChangeDBPassword = True ChangeDBPassword_Err: Regards, > how can I check if and mdb password is password protected
> or not? I need to write a code to check if the the mdb > file was not password, then setup a password for it. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||