473,545 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
+ 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 7838
"alijsyed" <al******@hotma il.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*****@localh ost.not> wrote in
news:SDpqe.3372 $2K4.946@trnddc 08:
"alijsyed" <al******@hotma il.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.Applicat ion

set acc = New Access.Applicat ion
acc.OpenCurrent Database FullFileNameTo. MDB[, ExclusiveFlag]
acc.CurrentDb.N ewPassword oldpwd, newpwd

acc.CloseCurren tDatabase
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).Ope nDatabase(m_sBa ckEndDatabaseFi le, True, _
False, ";PWD=" & sOldPass)
dbLink.NewPassw ord 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
3036
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 when CurrentUser() <> "xx" I just noticed that the property's can only be changed changed by a user belonging to 'Admins'. I never noticed this...
4
14011
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, but I converted it with the Access upsizing wizard to an Access ADP database with the Access front-end on the laptop connecting to the SQL Server on...
13
4925
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 active, but I bought like it to make it by code inside of a form in button command click. (I do not want to make it thought tools bars menu.) Can...
0
1400
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 are those generated by the Server Explorer. I can connect just fine using the default values. But when I comment out strDefaultConnectionFile...
22
3388
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 adoConnection = server.CreateObject("ADODB.Connection") Set adoRecordset = server.CreateObject("ADODB.Recordset") adoConnection.Provider =...
6
5136
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 to create a second group, called "localAdmin," for the admin-type person at the client. I want this group to be able to do some basic admin-type...
8
9615
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 work from
1
2313
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 "Users" or "Groups" in the "User and Group Accounts" and can only use the tab "Change Logon Password", but can I force a tab selection to the tab...
1
2117
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 going on here and is, this far from throughing my laptop into the wall..... I want to change cStr = "DRIVER={Microsoft Access Driver (*.mdb)};"...
0
7401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7756
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5326
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3442
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1879
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 we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
703
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.