怎么通过VB对一个重要的access的mdb文件加密。。
谁知道怎么通过VB对一个重要的access的mdb文件加密。。
[解决办法]
'退出系统
Sub AccessFormatToMem(FileName As String)
Dim str1 As String * 12
' Open FileName For Binary Access Read As #1
' Get #1, 5, str1
' Debug.Print FileName & " " & str1 & " " & Len(Trim(str1))
' Close #1
Open FileName For Binary Access Write As #1
str1 = " " 'Standard Jet
Put #1, 5, str1
Close #1
End Sub
'进入系统
Sub MemFormatToAccess(FileName As String)
Dim str1 As String * 12
' Open FileName For Binary Access Read As #1
' Get #1, 5, str1
' 'Debug.Print str1 & " " & Len(Trim(str1))
' Close #1
Open FileName For Binary Access Write As #1
str1 = "Standard Jet " 'Standard Jet
Put #1, 5, str1
Close #1
End Sub
[解决办法]
还是我帮你做了,说了半天你要原代码!
简单加密:ASC +1
Option Explicit
Dim x() As Byte
Private Sub Command1_Click()
Open "old.mdb " For Binary As #1
ReDim Preserve x(LOF(1) - 1) As Byte
Get #1, , x
Close #1
Dim intTemploop As Integer
For intTemploop = 0 To UBound(x)
If x(intTemploop) = 255 Then
x(intTemploop) = 0
Else
x(intTemploop) = x(intTemploop) + 1
End If
Next
Kill "old.mdb "
Open "new.mdb " For Binary As #1
Put #1, , x
Close #1
End Sub