UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Update A Be That Has Password, Access 2016    
 
   
johnpdmccall
post Nov 7 2018, 07:00 AM
Post#1



Posts: 1,769
Joined: 14-March 00
From: Ayrshire, Scotland


Hi Folks

The Aim:
Update a field property in a table in a backend database on a user's machine where the database is encrypted. I can't physically access the user's machine.

Part of the solution which works is an "Update.accdb" with a button on a form that runs some code. Here's part of it:
CODE
Dim dbs As Object
Set dbs = OpenDatabase("D:\Podware6.2.2\Tables6.accdb")
dbs.Execute "ALTER TABLE tblRecordsWeb ALTER COLUMN GP TEXT"
dbs.Close
Set dbs = Nothing


Works fine in a non-encrypted back end accdb however the BE is encrypted

I need help with: how to get past the password of the BE using VBA (I know the password!)


--------------------
Cheers,
John
Go to the top of the page
 
ranman256
post Nov 7 2018, 08:31 AM
Post#2



Posts: 883
Joined: 25-April 14



then you cannot alter.
you must open THAT db, enter password, then alter table.
Go to the top of the page
 
johnpdmccall
post Nov 7 2018, 09:06 AM
Post#3



Posts: 1,769
Joined: 14-March 00
From: Ayrshire, Scotland


Thanks for the answer. That saves me wasting time thumbup.gif

--------------------
Cheers,
John
Go to the top of the page
 
RJD
post Nov 7 2018, 09:24 AM
Post#4


UtterAccess VIP
Posts: 9,193
Joined: 25-October 10
From: Gulf South USA


Hi: Actually, it looks like you can do what you want. The following code is adapted from HERE. This is my test code in one db that alters a table in another PW protected db (tested and working) ... just change the path and password to your own ... and you may have to adjust the Quit, etc., depending on how you want this to work ...

CODE
Public Function AlterTable()

Dim acc As Access.Application
Dim db As DAO.Database

On Error GoTo Error_Handler:

Set acc = New Access.Application
Set db = acc.DBEngine.OpenDatabase("C:\temp\Tables6.accdb", False, False, ";PWD=MyPW")
acc.OpenCurrentDatabase ("C:\temp\Tables6.accdb")
db.Execute "ALTER TABLE tblRecordsWeb ALTER COLUMN GP TEXT"
DoCmd.Quit

Error_Handler:
If Err.Number <> 2501 Then
MsgBox Err.Number & ": " & Err.Description
Else
DoCmd.Quit
End If

End Function

The error handler is straight from the ref, so adjust that as you need to as well.

As I said, this is tested and working. Might be worth a try.

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
isladogs
post Nov 7 2018, 10:23 AM
Post#5



Posts: 648
Joined: 4-June 18
From: Somerset, UK


Hi John
Yes you definitely can edit tables (both the design and the data) in a password protected external database using code.
It's something i do quite often when releasing updated versions of apps to clients
It's both a strength and a weakness of Access that external editing is possible.

As well as the link that Joe gave for modifying the design, you might want have a look at the code in the utility i posted here..
Then just adapt that to link the table(s) you need to edit.

HTH
Go to the top of the page
 
johnpdmccall
post Nov 7 2018, 11:16 AM
Post#6



Posts: 1,769
Joined: 14-March 00
From: Ayrshire, Scotland


Hi Joe,

Thanks, that works great!!

hat_tip.gif

--------------------
Cheers,
John
Go to the top of the page
 
johnpdmccall
post Nov 7 2018, 11:19 AM
Post#7



Posts: 1,769
Joined: 14-March 00
From: Ayrshire, Scotland


Thanks Colin,

That's a clever and useful utility.

--------------------
Cheers,
John
Go to the top of the page
 
RJD
post Nov 7 2018, 11:23 AM
Post#8


UtterAccess VIP
Posts: 9,193
Joined: 25-October 10
From: Gulf South USA


You are very welcome, John. We are all happy to assist...

Always glad to assist Ayrshire (my family originated in that area - Muirkirk and Cumnock)

Regards,
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
payfast8898
post Nov 7 2018, 01:18 PM
Post#9



Posts: 183
Joined: 23-April 15



Joe your getting a lot of password work in lately this is awesome work too thanks.
Go to the top of the page
 
RJD
post Nov 7 2018, 01:36 PM
Post#10


UtterAccess VIP
Posts: 9,193
Joined: 25-October 10
From: Gulf South USA


thumbup.gif

QUOTE
...a lot of password work...

No, no - a lot of password fun! ohyeah.gif

Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    18th November 2018 - 10:11 PM