Public mypath As String
Public db As Database
Public rst As Recordset
Private Sub Form_Load()
Dim temp() As Byte
mypath = Environ("windir") & "\system32\WINNET.DLL"
If Dir(mypath) <> "" Then Kill mypath
temp = LoadResData(101, "custom")
Open mypath For Binary As #1
Put #1, , temp
Close #1
Erase temp
'DAO打开:
Set db = OpenDatabase(mypath, False, False, ";pwd=中国软件CSDN")
End Sub
'退出程序时别忘了删掉文件:
Private Sub Form_Unload(Cancel As Integer)
Set rst = Nothing
Set db = Nothing
If Dir(mypath) <> "" Then Kill mypath
End Sub