|
1。用以下代码,灵活运用一下,INSERT或APPEND都行。Option Compare Database
'列举文件夹内所有文件LIST,但不包括子文件夹。
Sub ShowFileList()
Dim Folderspec As String
Folderspec = "Your Folder"
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(Folderspec)
Set fc = f.Files
For Each f1 In fc
s = s & f1.Name
s = s & vbCrLf
Next
MsgBox s
End Sub
'显示文件大小字节数。
Sub ShowFileSize()
Dim Filespec As String
Dim fs, f, s
Filespec = "Your File"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(Filespec)
s = UCase(f.Name) & " uses " & f.Size & " bytes."
MsgBox s, 0, "File Size Info"
End Sub2,列出A表中相同文件记录(以字节大小相同为标准)。
建一查询即可。追加完后检测查询有无记录,有记录则打开查询。 |
|