Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do digital signature ?

Status
Not open for further replies.

catty1160

Technical User
Mar 10, 2003
38
US
Hi: I like to create a button for digital signature. Assume I have a table (tbl_Records) taht has 7 fields. Fields 1 to 4 are memo fields to take data entry. Field 5 is Yes/No field indicates Signed or Not. Field 6 is User name and field 7 is Password. frm_Records is the form to feed tbl_Records with same fields of tbl_Records. The idea is this:

1. In frm_Records, Users can enter data in fileds 1 to 4. After they finish, if they want to sign,they have to enter in the field of username (field 6) and password (field 7). If both fields match, the button for Signature (btn_ToSign) will become visible for user to click.

2. After the authenticated user click on the btn_ToSign, he will be prompt with a confirmation window to confirm that he wants to digital sign the record, and inform the user that after the signing process the record can not be edited any more.

3. If the user chooses to proceed and sign, the field 5 (Signed-Unsigned) will change from Unsigned to Signed. The field 5 in tbl_Records will be changed form No to Yes
(Signed).

Placing Field 6(User name) and 7(password)in the same form is just my idea, maybe it in not the best to setup in this way. The other option is to autheticate users when they login the program. Anybody who is logined can open the frm_Records to enter the data and decide to sign or not. Under this option, we won't need Field6 and 7 in frm_Records. Either way is fine with my work. Which way is better? How to do it? Please advise. Thanks.

Catty
 
I'd recommend you make them "enter password" every time they "digital sign". You can verify a user password by using the following command:
Code:
On Error Resume Next
Dim ws as Workspace
Set ws = DBEngine.CreateWorkspace "putsomerandomnameoraworkgroupfilename"_
,"username","password"

If Err.Number = 3033 Then
    MsgBox "Wrong password ETC"
ElseIf Err.Number = 0 Then
    'Do whatever here
Else
    'General error-handling
End If
--
Find common answers using Google Groups:

 
Foolio;

Thank you for this part. But why using number 3303, and 0?

Any idea to make the the records become un-editable after signing and change field 5 from unsigned to signed?



 
I'm getting a little more nervous about this digital signature thing. First off:

Error 3033, in this case indicates the user has a wrong password. Any other error number, and it's a different type of error.

Error 0 is no error. The reason why I specifically (actually I got this code off of a newsgroup posting as to how to change a password via code), why someone used Code 0 is because if the error is anything but 0 or 3033, it's an unidentified (unhandled?) error.


Moving on: Access security sucks. Depending on the level of sensitivity of this information, you may want to try and ensure some more "real" security. Because no matter how you "disable" field5 in the form, someone can open up the table directly and change ALL the fields to "GIVE ME A MILLION DOLLARS" or whatever they feel like.

What I'm saying is that I have simple answers to your good questions, but don't want to encourage you use form-enforced security if your data is very important/sensitive. On the other hand, if someone is "digital signing" their timesheet each week, maybe there won't be a problem.

On to the answers:
1. Whenever the user "signs", and it succeeds, all you have to do is add "chkCheckBoxName.Value = True" (supply real checkbox control name), then save the record using RunCommand acCmdSaveRecord, then set "Me.AllowEdits = False".

I believe this will work.

2. To restrict any editing on a "signed" copy: again, directly editing the tables foils any form-based-security you may have. Again, the answer:
On the Form_Current() event. 1. Create this event if it does not exist. 2. In this event, put:
Code:
If chkCheckBoxName.Value = True Then
    Me.AllowEdits = False
Else
    Me.AllowEdits = True
End If

This should restrict access to these records, at least superficially. Which may be all you need. --
Find common answers using Google Groups:

 
Hi, Foolio:

Thank you for your "nervous" input. I feel nervous of digital signature too since there are legitimate issue around. Anyway, let's not worry about it now. Definitely, your points are very good and make sense. Since I am not that advanced in Access code writing yet, (maybe even not that intermediate yet) I need to spend some time to put every thing together, following your points, try to make it work. I am sure I will have some problems (It seems "always" in the past!) to get it straight out. I will get back to you.

Catty
 
Hi, Foolio:

I agree with your points regarding Form security.But, ... I did try to follow your advise to make it work, I found several problems:

1. Your code to check password is hard to understand for me.

On Error Resume Next
Dim ws as Workspace
Set ws = DBEngine.CreateWorkspace "putsomerandomnameoraworkgroupfilename"_
,"username","password"

Can you explain the part DBEngine.Creatworkspace..... , "password"

it is not like the code I saw before for checking password.

2. I make the table, tbl_Record, with 7 fieldss. the fields are named as Field1, Field2, Field3, Feild4, (all these are memo fields for data entry), Signed (Yes/No filed), UserName, Password. frm_Record has same 7 fields name. In frm_Record Current event procedure, I place this code as you directed:

If chkSigned.Value = True Then
Me.AllowEdits = False
Else
Me.AllowEdits = True
End If

Unfortunately,it did not work. I marked the chkSigned, but I still can change the data in Field1 to "You owe me one million" very easily. I am stuck.

3. I noted you did not indicate a stored source to store all the users and password, then how can we check user's password to match to the existing users?

Still far away from getting there..., Please direct me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top