473,473 Members | 1,488 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How do I change an MS Access Database PAssword from VB Code

I am trying to change an existing database password from VB 6.
The database is an MS Access 2000 database if this helps
How do I do this?
Any help is appreciated.
Thanks

Ali

Nov 13 '05 #1
3 7824
"alijsyed" <al******@hotmail.com> wrote
I am trying to change an existing
database password from VB 6.
The database is an MS Access 2000
database if this helps


I'm sure this is possible if you are very knowledgeable of the internals,
but AFAIK there is no documented method... if there were, what would prevent
anyone who wanted to grab your data from doing the same?

Larry Linson
Microsoft Access MVP
Nov 13 '05 #2
"Larry Linson" <bo*****@localhost.not> wrote in
news:SDpqe.3372$2K4.946@trnddc08:
"alijsyed" <al******@hotmail.com> wrote
I am trying to change an existing
database password from VB 6.
The database is an MS Access 2000
database if this helps


I'm sure this is possible if you are very knowledgeable of the
internals, but AFAIK there is no documented method... if there were,
what would prevent anyone who wanted to grab your data from doing the
same?

Larry Linson
Microsoft Access MVP


I thought you could do some of this with ADOX?

At the very least, assuming you know the existing Database password (as
opposed to a given user password...), you should be able to do it through
Automation, even in VB...

(reference "Microsoft Access X.0 Object Library" in the VB app), then...

Dim acc as Access.Application

set acc = New Access.Application
acc.OpenCurrentDatabase FullFileNameTo.MDB[, ExclusiveFlag]
acc.CurrentDb.NewPassword oldpwd, newpwd

acc.CloseCurrentDatabase
set acc=nothing

If you actually have a secured database, then you have to either do it
through DAO or with the ADOX library, after logging into the database as
a user in the Admins group or as the database owner.
Nov 13 '05 #3
alijsyed wrote:
I am trying to change an existing database password from VB 6.
The database is an MS Access 2000 database if this helps


It depends on which object model you are using in VB - DAO or ADO.

The DAO method should be something like this:

Dim dbLink As DAO.Database
Set dbLink = DBEngine(0).OpenDatabase(m_sBackEndDatabaseFile, True, _
False, ";PWD=" & sOldPass)
dbLink.NewPassword sOldPass, sNewPass
dbLink.Close
Set dbLink = Nothing

where sOldPass is the old password and sNewPass is the new one. I would think you need
exclusive use of the database to do this so there may be additional code required.
Search on the undocumented PrivDBEngine call to see one way of determining this.

All the mantras apply of course - the Database password really supplies little security
other than keeping honest users out...

--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Arno R | last post by:
Hi there, I just distributed an application in which I (try to) change db.properties depending on CurrentUser() For instance I set the property's AllowBypassKey and AllowBuiltinToolbars to False...
4
by: rcmail14872 | last post by:
I have MS SQL Server 2000 evaluation version on my desktop PC. I have the SQL Server client tools (only) on the laptop. The two computers are networked. I had an Access MDB database on my laptop,...
13
by: Javier Gomez | last post by:
Is it posible to change by code (in a form) the active .mdw by another one ? When I open the DB I have the system.mdw active after some procesess I need to change to another secure.mdw and make...
0
by: tconlon | last post by:
Hi folks. I'm trying to change the location of the Access mdb file I connect to using OleDb and am having trouble. I'm using Visual C# 2005 and the default values I use for the ConnectionString...
22
by: Bob and Sharon Hiller | last post by:
I have an ASP page that was done in VBScript It is setup to read an Access database and I need to change it to read a Sql 2005 Database. The code that is used to open the Access Database: Set...
6
by: Jan | last post by:
Hi: I have created a secured database for a client. For various reasons, I don't want the client to have full persmissions for the database; they aren't in the admins group. I have instead tried...
8
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query...
1
by: eighthman11 | last post by:
Hi everyone: I created a custom toolbar called Password, so users can change their password. I used the Command "User and Group Accounts". I know the user can not change anything in the Tab...
1
by: webandwe | last post by:
Hi, Can somebody please show me how to change the connection so I can make it work with my MYSQL database... I just need this login to work then I'm done wiht my project. I don't know what is...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.