从CD读取和导入文件夹名称? [英] Read and Import folder names from a CD?

查看:91
本文介绍了从CD读取和导入文件夹名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能,如果是这样,我怎样才能读取并导入文件夹名称

从CD到桌子?


感谢您的帮助。

解决方案

Cd通常是D盘。从帮助文件:


''在C:\中显示代表目录的名称。

MyPath =" c:\" ''设置路径。

MyName = Dir(MyPath,vbDirectory)''检索第一个条目。

Do MyName<> "" ''开始循环。

''忽略当前目录和包含目录。

如果MyName<> "。"和MyName<> " .."然后

''使用按位比较来确保MyName是一个目录。


If(GetAttr(MyPath& MyName)和vbDirectory)= vbDirectory然后

Debug.Print MyName''仅显示条目

结束如果''表示目录。

结束如果

MyName = Dir''获取下一个条目。

循环


将上面的C改为D.添加记录集以及AddNew和Update方法

上述循环的记录集,用于将每个文件夹名称写入表格。


-

PC数据表

您的资源以获取Access,Excel和Word应用程序的帮助

超过1150位用户来自新闻组请求帮助
re ****** @ pcdatasheet.com


" Shyguy" < SH **** @ aol.com>在消息中写道

新闻:2c ******************************** @ 4ax.com ...

是否有可能,如果是这样,我如何阅读并将文件夹名称从CD导入表格?

感谢您的帮助。



到原始海报:


人们普遍认为这些新闻组是免费交换的

信息。请注意,PC数据表是一个臭名昭着的求职者。

如果你正在考虑与他做生意,那么我建议你先看看下面的链接

a。 br /> http://home.tiscali.nl/arracom/whoissteve.html


" Steve" <无**** @ nospam.spam>在消息中写道

新闻:Du *************** @ newsread2.news.atl.earthlin k.net ...

Cd通常是D驱动器。从帮助文件:

''在C:\中显示代表目录的名称。
MyPath =" c:\" ''设置路径。
MyName = Dir(MyPath,vbDirectory)''检索第一个条目。
Do While MyName<> "" ''开始循环。
''忽略当前目录和包含目录。
如果MyName<> "。"和MyName<> " .."然后
''使用按位比较来确保MyName是一个目录。

如果(GetAttr(MyPath& MyName)和vbDirectory)= vbDirectory那么
Debug.Print MyName' '仅显示条目
结束如果''表示目录。
结束如果
MyName = Dir''获取下一个条目。
循环
将上面的C更改为D.将记录集的记录集和AddNew和Update方法
添加到上面的循环中,将每个文件夹名称写入表格。

-
PC数据表
您的资源获取Access,Excel和Word应用程序的帮助
超过1150位用户来自新闻组请求帮助
re ****** @ pcdatasheet.com

" Shyguy" < SH **** @ aol.com>在消息中写道
新闻:2c ******************************** @ 4ax.com ... < blockquote class =post_quotes>是否有可能,如果是这样,我如何阅读并将文件夹名称从CD导入到桌面?

感谢您的帮助。





祝贺另外25人。我相信他们所有人都会很快发布支持信息。就像其他1125还没有完成一样。


" Steve" <无**** @ nospam.spam>在消息中写道

新闻:Du *************** @ newsread2.news.atl.earthlin k.net ...

Cd通常是D驱动器。从帮助文件:

''在C:\中显示代表目录的名称。
MyPath =" c:\" ''设置路径。
MyName = Dir(MyPath,vbDirectory)''检索第一个条目。
Do While MyName<> "" ''开始循环。
''忽略当前目录和包含目录。
如果MyName<> "。"和MyName<> " .."然后
''使用按位比较来确保MyName是一个目录。

如果(GetAttr(MyPath& MyName)和vbDirectory)= vbDirectory那么
Debug.Print MyName' '仅显示条目
结束如果''表示目录。
结束如果
MyName = Dir''获取下一个条目。
循环
将上面的C更改为D.将记录集的记录集和AddNew和Update方法
添加到上面的循环中,将每个文件夹名称写入表格。

-
PC数据表
您的资源获取Access,Excel和Word应用程序的帮助
超过1150位用户来自新闻组请求帮助
re ****** @ pcdatasheet.com

" Shyguy" < SH **** @ aol.com>在消息中写道
新闻:2c ******************************** @ 4ax.com ... < blockquote class =post_quotes>是否有可能,如果是这样,我如何阅读并将文件夹名称从CD导入到桌面?

感谢您的帮助。



Is it possible, and if so how would I read and import folder names
from a CD to a table?

Thank you for any help.

解决方案

A Cd is ususually the D drive. From the Help file:

'' Display the names in C:\ that represent directories.
MyPath = "c:\" '' Set the path.
MyName = Dir(MyPath, vbDirectory) '' Retrieve the first entry.
Do While MyName <> "" '' Start the loop.
'' Ignore the current directory and the encompassing directory.
If MyName <> "." And MyName <> ".." Then
'' Use bitwise comparison to make sure MyName is a directory.

If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
Debug.Print MyName '' Display entry only if it
End If '' it represents a directory.
End If
MyName = Dir '' Get next entry.
Loop

Change C in above to D. Add a recordset and the AddNew and Update methods of
the recordset to the above loop to write each folder name to a table.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1150 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com

"Shyguy" <sh****@aol.com> wrote in message
news:2c********************************@4ax.com...

Is it possible, and if so how would I read and import folder names
from a CD to a table?

Thank you for any help.



To the original poster:

It is commonly accepted that these newsgroups are for free exchange of
information. Please be aware that PC Datasheet is a notorious job hunter.
If you are considering doing business with him then I suggest that you take
a look at the link below first.
http://home.tiscali.nl/arracom/whoissteve.html

"Steve" <no****@nospam.spam> wrote in message
news:Du***************@newsread2.news.atl.earthlin k.net...

A Cd is ususually the D drive. From the Help file:

'' Display the names in C:\ that represent directories.
MyPath = "c:\" '' Set the path.
MyName = Dir(MyPath, vbDirectory) '' Retrieve the first entry.
Do While MyName <> "" '' Start the loop.
'' Ignore the current directory and the encompassing directory.
If MyName <> "." And MyName <> ".." Then
'' Use bitwise comparison to make sure MyName is a directory.

If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
Debug.Print MyName '' Display entry only if it
End If '' it represents a directory.
End If
MyName = Dir '' Get next entry.
Loop

Change C in above to D. Add a recordset and the AddNew and Update methods of the recordset to the above loop to write each folder name to a table.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1150 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com

"Shyguy" <sh****@aol.com> wrote in message
news:2c********************************@4ax.com...

Is it possible, and if so how would I read and import folder names
from a CD to a table?

Thank you for any help.





And congratulations on another 25 people on the total. I''m sure they''ll all
be posting supportive messages soon. Just like the other 1125 haven''t done.

"Steve" <no****@nospam.spam> wrote in message
news:Du***************@newsread2.news.atl.earthlin k.net...

A Cd is ususually the D drive. From the Help file:

'' Display the names in C:\ that represent directories.
MyPath = "c:\" '' Set the path.
MyName = Dir(MyPath, vbDirectory) '' Retrieve the first entry.
Do While MyName <> "" '' Start the loop.
'' Ignore the current directory and the encompassing directory.
If MyName <> "." And MyName <> ".." Then
'' Use bitwise comparison to make sure MyName is a directory.

If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
Debug.Print MyName '' Display entry only if it
End If '' it represents a directory.
End If
MyName = Dir '' Get next entry.
Loop

Change C in above to D. Add a recordset and the AddNew and Update methods of the recordset to the above loop to write each folder name to a table.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1150 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com

"Shyguy" <sh****@aol.com> wrote in message
news:2c********************************@4ax.com...

Is it possible, and if so how would I read and import folder names
from a CD to a table?

Thank you for any help.




这篇关于从CD读取和导入文件夹名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆