accessing default CD ROM drive

J

JAmateur

I would like to access a text file from the default cd rom drive for any
computer. Could you help me determine the VBA code for this?

Thanks,
Jim
 
B

Brendan Reynolds

There's code at the following URL to detect available drives and their
types. I'm not sure about 'default' CD-ROM drive, though - I could be wrong,
but I don't think Windows regards any CD-ROM drive as being the 'default'.
Of course, if anyone knows differently, please don't hesitate to say so.

http://www.mvps.org/access/api/api0003.htm

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
D

Douglas J. Steele

I believe you're correct, Brendan. I'm not aware of any way of determining a
'default' CD-ROM drive.

Related to this topic, a mistake many applications make is to ignore the
possibility that there can be multiple CD-ROM drives.
 
B

Brendan Reynolds

Well, Jim is one step ahead of the pack, then! :)

Jim, I think probably the best you can do, short of prompting the user to
decide, is default to the first drive letter (in ascending alphabetical
order) that the API code at that URL identifies as a CD-ROM drive.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Top