【发布时间】:2017-11-10 01:53:43
【问题描述】:
我在前端和后端有一个数据库拆分。
我让它运行: i) 在我的办公室 ii) 在我的个人电脑上更新/测试。
我的后端文件根据计算机运行在不同的文件夹位置。
我想放置一个代码并检查文件是否存在。
代码:
Sub FileExists()
Dim strPath As String '<== Office.
Dim strApplicationFolder As String
Dim strPathAdmin As String '<== Admin.
strPath = "\\iMac\Temp\"
strApplicationFolder = Application.CurrentProject.Path
strPathAdmin = strApplicationFolder & "\Temp\"
If Dir(strApplicationFolder & "SerialKey.txt") = "" Then
'===> Admin User.
If Dir(strPathAdmin & "*.*") = "" Then
'===> Empty Folder.
Else
'===> Files on folder.
End If
Else
'===> Office User.
If Dir(strPath & "*.*") = "" Then
'===> Empty Folder.
Else
'===> Files on folder.
End If
End If
End Sub()
到现在为止。
任何帮助。
谢谢...
【问题讨论】: