【Access示例】创建多级目录
时 间:2019-01-11 09:06:15
作 者:缪炜 ID:24010 城市:江阴
摘 要:创建多级目录
正 文:
创建多级目录。
附 件:
示例演示:
主要代码:
Public Function createMultiLevelFolder(path As String) As Boolean
On Error GoTo errHandler
Dim index As Integer, tempPath As String
createMultiLevelFolder = False
If Len(Trim(path)) = 0 Then
Exit Function
End If
index = InStr(1, path, "/")
Do While index > 0
tempPath = Left(path, index) '这里index(“/”所在的位置)可视为要截取的字符长度
If tempPath = "//" Then
'对“//”后面的主机名或IP不处理
index = InStr(index + 1, path, "/")
Else
If Dir(tempPath, vbDirectory) = "" Then
MkDir tempPath
End If
End If
index = InStr(index + 1, path, "/") '返回下一个“/”的位置
Loop
createMultiLevelFolder = True
errHandler:
If Err.Number Then
MsgBox "创建多级目录(" & path & ")时出错:" & Err.Description, vbInformation, "错误"
createMultiLevelFolder = False
Resume Next
End If
End Function
Access软件网QQ交流群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 统计当月之前(不含当月)的记录...(03.11)
- 【Access Inputbo...(03.03)
- 按回车键后光标移动到下一条记录...(02.12)
- 【Access Dsum示例】...(02.07)
- Access对子窗体的数据进行...(02.05)
- 【Access高效办公】上月累...(01.09)
- 【Access高效办公】上月累...(01.06)
- 【Access Inputbo...(12.23)
- 【Access Dsum示例】...(12.16)

学习心得
最新文章
- Access控件美化之--美化按钮...(04.19)
- Access多行文本按指定字符筛选...(04.18)
- Microsoft Access数...(04.18)
- 仓库管理实战课程(12)-月度结存...(04.16)
- 仓库管理实战课程(11)-人性化操...(04.15)
- 32位的Access软件转化为64...(04.12)
- 【Access高效办公】如何让vb...(04.11)
- 仓库管理实战课程(10)-入库功能...(04.08)
- Access快速开发平台--Fun...(04.07)
- 仓库管理实战课程(9)-开发往来单...(04.02)