Selfcert alternative

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

I have created a database for a friend of mine. He, understandably, is
reluctant to set his macro security to low. However, he also does not want
to be bothered by pesky security warnings whenever he opens the database. I
have tried using the selfcert.exe to sign the project, but he still gets a
warning everytime he opens it because it was created with my key (we're in
different states, so signing it on his computer isn't an option).
Because this is a 1 time thing, and I'm donating this to him, I really don't
want to pay a $100/yr subscription on something like VeriSign. Are there any
other alternatives?

Thanks in advance for any advice.
 
hi,

Digital signatures that are created with the SelfCert program are for
personal use only. They are not meant for commercial distribution of VBA
solutions. The type of certificate that is generated does not verify your
identity.

Microsoft® maintains a list of trusted third-party commercial certificate
authorities to enable secure and usable e-commerce for Microsoft® Windows®
users. These certificate authorities validate the identity and entitlement of
an applicant, and as an output of this process, issue the applicant a digital
certificate.

Access the list here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsecure/html/rootcertprog.asp

Regards,
 
Thank you for your rapid response. Your link is a very useful resource for
people who are getting paid for their projects and are working as developers
that are making multiple projects in any given year.

Unfortunately, I am not a professional developer. I'm just trying to help a
friend out. Because I do not make much money, I find myself in a sticky
situation regarding the cost of the certificates I find there. I was hoping
to find a free alternative, are there any?
 
Hi Tim

I understand your frustration!

Create a text file and paste the following VB Script code into it. Insert
the filename of the database in the obvious place and save it with a
filetype of ".vbs". Then open the script file directly or, if you prefer,
create a shortcut to the script file and put the MS Access icon on it.

========== start code ================
Const cDatabaseToOpen = "C:<path to your database>.mdb"
Const msoAutomationSecurityLow = 1
On Error Resume Next
Dim AcApp
Set AcApp = CreateObject("Access.Application")
If AcApp.Version = 11 Then
AcApp.AutomationSecurity = msoAutomationSecurityLow
End If
AcApp.OpenCurrentDatabase cDatabaseToOpen
If Err = 0 Then
AcApp.Visible = True
AcApp.UserControl = True
Else
AcApp.Quit
MsgBox "Failed to open '" & cDatabaseToOpen _
& "'." & vbCrLf & Err.Description
End If
========== end code ===================
 
Thanks Graham! This worked a treat!

I do have 2 questions, though:

1.) In looking at this script, it appears that what it does is
programmatically set the macro security to low. I'm assuming that is file
specific, and wouldn't translate into every db my friend opens. Is that
right, or do I need to use an altered version of your wonderful code to make
an exit script setting it back to medium/high?

2.) This one's a bit trickier: I've been trying to think of a way to allow
my friend to define the path of the database here. I'm assuming if I insert
into your script an alteration of the Open/Save dialog that this shouldn't be
a problem. However; I'm looking to make it so that he can define the path
once, and not have to do it again until the path is changed.

If, for example, in addition to this, I throw in the script for the
Open/Save dialog (I won't paste it all here) and add in the following:

Dim strDBPath as String

strDBPath = <defined via open/save dialog>

Const cDatabaseToOpen = strDBPath
<resume the script you posted>

I'm no expert, but I think this will work where my friend can define the
path...but he'll have to do so every time he opens the database. Is there a
way to save the strDBPath and only redefine it if it is no longer valid?

If not, it's no huge deal, I would just prefer to tell him he can place his
db wherever he wants on his hard drive rather than forcing him to create a
static location defined by me.

TIA,
Tim
Graham Mandeno said:
Hi Tim

I understand your frustration!

Create a text file and paste the following VB Script code into it. Insert
the filename of the database in the obvious place and save it with a
filetype of ".vbs". Then open the script file directly or, if you prefer,
create a shortcut to the script file and put the MS Access icon on it.

========== start code ================
Const cDatabaseToOpen = "C:<path to your database>.mdb"
Const msoAutomationSecurityLow = 1
On Error Resume Next
Dim AcApp
Set AcApp = CreateObject("Access.Application")
If AcApp.Version = 11 Then
AcApp.AutomationSecurity = msoAutomationSecurityLow
End If
AcApp.OpenCurrentDatabase cDatabaseToOpen
If Err = 0 Then
AcApp.Visible = True
AcApp.UserControl = True
Else
AcApp.Quit
MsgBox "Failed to open '" & cDatabaseToOpen _
& "'." & vbCrLf & Err.Description
End If
========== end code ===================

--
Good luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Hi there,

I have created a database for a friend of mine. He, understandably, is
reluctant to set his macro security to low. However, he also does not want
to be bothered by pesky security warnings whenever he opens the database. I
have tried using the selfcert.exe to sign the project, but he still gets a
warning everytime he opens it because it was created with my key (we're in
different states, so signing it on his computer isn't an option).
Because this is a 1 time thing, and I'm donating this to him, I really don't
want to pay a $100/yr subscription on something like VeriSign. Are there any
other alternatives?

Thanks in advance for any advice.
 
Hi Tim

Answers inline...
Thanks Graham! This worked a treat!

Excellent! Glad it did the trick :-)
I do have 2 questions, though:

1.) In looking at this script, it appears that what it does is
programmatically set the macro security to low. I'm assuming that is file
specific, and wouldn't translate into every db my friend opens. Is that
right, or do I need to use an altered version of your wonderful code to
make
an exit script setting it back to medium/high?

No, it changes the security level only for that instance of the Access
application - not even for the MDB file. If you later open the MDB by just
double-clicking on it, it will behave the same way as before.
2.) This one's a bit trickier: I've been trying to think of a way to allow
my friend to define the path of the database here. I'm assuming if I
insert
into your script an alteration of the Open/Save dialog that this shouldn't
be
a problem. However; I'm looking to make it so that he can define the path
once, and not have to do it again until the path is changed.
[snip]

I can't think of any way of storing the result of the first call to the
Open/Save dialog, unless it's in the registry or in an associated text file,
but that's getting way too complex.
I'm no expert, but I think this will work where my friend can define the
path...but he'll have to do so every time he opens the database. Is there
a
way to save the strDBPath and only redefine it if it is no longer valid?

If not, it's no huge deal, I would just prefer to tell him he can place
his
db wherever he wants on his hard drive rather than forcing him to create a
static location defined by me.

The easiest way is to tell him to edit the VBS file. Just open it with
notepad, edit the line that starts:
Const cDatabaseToOpen =
and save it.

If he wants to move the database, just edit the script again.
 
Thanks for all of your help! I think your solution with the vbs file will
work great!

Graham Mandeno said:
Hi Tim

Answers inline...
Thanks Graham! This worked a treat!

Excellent! Glad it did the trick :-)
I do have 2 questions, though:

1.) In looking at this script, it appears that what it does is
programmatically set the macro security to low. I'm assuming that is file
specific, and wouldn't translate into every db my friend opens. Is that
right, or do I need to use an altered version of your wonderful code to
make
an exit script setting it back to medium/high?

No, it changes the security level only for that instance of the Access
application - not even for the MDB file. If you later open the MDB by just
double-clicking on it, it will behave the same way as before.
2.) This one's a bit trickier: I've been trying to think of a way to allow
my friend to define the path of the database here. I'm assuming if I
insert
into your script an alteration of the Open/Save dialog that this shouldn't
be
a problem. However; I'm looking to make it so that he can define the path
once, and not have to do it again until the path is changed.
[snip]

I can't think of any way of storing the result of the first call to the
Open/Save dialog, unless it's in the registry or in an associated text file,
but that's getting way too complex.
I'm no expert, but I think this will work where my friend can define the
path...but he'll have to do so every time he opens the database. Is there
a
way to save the strDBPath and only redefine it if it is no longer valid?

If not, it's no huge deal, I would just prefer to tell him he can place
his
db wherever he wants on his hard drive rather than forcing him to create a
static location defined by me.

The easiest way is to tell him to edit the VBS file. Just open it with
notepad, edit the line that starts:
Const cDatabaseToOpen =
and save it.

If he wants to move the database, just edit the script again.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand
 
Back
Top