473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Looking for an easy way to browse the file system

Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to rely
on a new reference? I've used this code since the Access Version 2.0 days,
so I would figure there has to be something a little more compact, but I
can't seem to find anything in the help file.

Any ideas?

Thanks!
Nov 13 '05 #1
7 1471
No, the API call is still the best way to go. You need the 32-bit version of
the code for all versions since Access 95 though. Here 'tis:
http://www.mvps.org/access/api/api0001.htm

There have been other options over the years, including common dialogs which
were buggy and prone to breaking when you switched versions. As you probably
know, a broken reference breaks the entire app, not just the file open part.

Access 2002 and 2003 have a FileDialog object, but it's also useless. It's
part of the Office library (another reference to break), and so it doesn't
work in the mde/runtime where the Office library is not available. Worse, if
appears to offer the File | Save As choice, but that doesn't work at all.

So, the API call is still the only reliable, consistent approach.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jozef" <SP**********@telus.net> wrote in message
news:td3ve.1795446$6l.359547@pd7tw2no...
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to
rely on a new reference? I've used this code since the Access Version 2.0
days, so I would figure there has to be something a little more compact,
but I can't seem to find anything in the help file.

Any ideas?

Thanks!

Nov 13 '05 #2
Jozef wrote:
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to rely
on a new reference? I've used this code since the Access Version 2.0 days,
so I would figure there has to be something a little more compact, but I
can't seem to find anything in the help file.


Avoiding additional references is a *good* thing so avoid the FileScriptingObject.

The built-in method in VBA to use is Dir() function. Check out the help.

Also the GetAttr() is useful.
--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #3
Hi John,

Thanks, it's a dialog that I'm looking for though. I'm already familiar
with Dir and GetAttr etc. I can't find much about the browse dialog in the
helpfile, which is why I usually post here.
Thanks!

"John Mishefske" <mi************@JUNKtds.net> wrote in message
news:42********@newspeer2.tds.net...
Jozef wrote:
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to
rely on a new reference? I've used this code since the Access Version
2.0 days, so I would figure there has to be something a little more
compact, but I can't seem to find anything in the help file.


Avoiding additional references is a *good* thing so avoid the
FileScriptingObject.

The built-in method in VBA to use is Dir() function. Check out the help.

Also the GetAttr() is useful.
--
'---------------
'John Mishefske
'---------------

Nov 13 '05 #4
Jozef wrote:
Hi John,

Thanks, it's a dialog that I'm looking for though. I'm already familiar
with Dir and GetAttr etc. I can't find much about the browse dialog in the
helpfile, which is why I usually post here.
Thanks!

"John Mishefske" <mi************@JUNKtds.net> wrote in message
news:42********@newspeer2.tds.net...
Jozef wrote:
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to
rely on a new reference? I've used this code since the Access Version
2.0 days, so I would figure there has to be something a little more
compact, but I can't seem to find anything in the help file.
Avoiding additional references is a *good* thing so avoid the
FileScriptingObject.

The built-in method in VBA to use is Dir() function. Check out the help.

Also the GetAttr() is useful.


Understood. I couldn't tell from your original post. See Allen Browne's response - he's
got the answer you need.
Allen Browne said:
No, the API call is still the best way to go. You need the 32-bit version of
the code for all versions since Access 95 though. Here 'tis:
http://www.mvps.org/access/api/api0001.htm


--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #5
Thanks John

"John Mishefske" <mi************@JUNKtds.net> wrote in message
news:42**********@newspeer2.tds.net...
Jozef wrote:
Hi John,

Thanks, it's a dialog that I'm looking for though. I'm already familiar
with Dir and GetAttr etc. I can't find much about the browse dialog in
the helpfile, which is why I usually post here.
Thanks!

"John Mishefske" <mi************@JUNKtds.net> wrote in message
news:42********@newspeer2.tds.net...
Jozef wrote:

Hello,

I have some archaic code that I've always used to browse the file
system. Is there anything short and sweet I could use intead, without
having to rely on a new reference? I've used this code since the Access
Version 2.0 days, so I would figure there has to be something a little
more compact, but I can't seem to find anything in the help file.

Avoiding additional references is a *good* thing so avoid the
FileScriptingObject.

The built-in method in VBA to use is Dir() function. Check out the help.

Also the GetAttr() is useful.


Understood. I couldn't tell from your original post. See Allen Browne's
response - he's got the answer you need.
Allen Browne said:
No, the API call is still the best way to go. You need the 32-bit
version of
the code for all versions since Access 95 though. Here 'tis:
http://www.mvps.org/access/api/api0001.htm


--
'---------------
'John Mishefske
'---------------

Nov 13 '05 #6
Thanks Allen! I had a chance to try that out and it's perfect. It's a
WHOLE lot smaller than the current code I'm using.

Thanks again!
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:42***********************@per-qv1-newsreader-01.iinet.net.au...
No, the API call is still the best way to go. You need the 32-bit version
of the code for all versions since Access 95 though. Here 'tis:
http://www.mvps.org/access/api/api0001.htm

There have been other options over the years, including common dialogs
which were buggy and prone to breaking when you switched versions. As you
probably know, a broken reference breaks the entire app, not just the file
open part.

Access 2002 and 2003 have a FileDialog object, but it's also useless. It's
part of the Office library (another reference to break), and so it doesn't
work in the mde/runtime where the Office library is not available. Worse,
if appears to offer the File | Save As choice, but that doesn't work at
all.

So, the API call is still the only reliable, consistent approach.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jozef" <SP**********@telus.net> wrote in message
news:td3ve.1795446$6l.359547@pd7tw2no...
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to
rely on a new reference? I've used this code since the Access Version
2.0 days, so I would figure there has to be something a little more
compact, but I can't seem to find anything in the help file.

Any ideas?

Thanks!


Nov 13 '05 #7
I realize the original poster specified not setting a new reference.
Although I have written my own versions of api call for file browsing I
have discarded these as I find it much easier to set a reference to
"Microsoft Shell Controls and Automation" and to run:
Dim s As Shell32.Shell
Set s = New Shell32.Shell
s.Explore ("C:\")
The reference exposes a great many procedures, functions and dialogs,
including the BrowseForFolder Dialog.
If one prefers late binding:
Dim s As Object
Set s = CreateObject("Shell.Application")
s.Explore ("C:\")

Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and...
21
by: strutsng | last post by:
<input type="file"> only allows the user to browse for files. How about "browse for folder" dialog? Can html/javascript do that? I couldn't find any syntax for that. If not, please advise what...
3
by: Wardeaux | last post by:
Hey all, need sample/article how to let user browse local drives to select a file and have the local drive location returned so I can store it in my db, similar to a file upload but without the...
3
by: UJ | last post by:
How can I add a browse button to my asp.net page? What I need is a button they can press that will then let them select the file to upload to the server. And if anybody has any good code on how...
5
by: Mike Moore | last post by:
I need to create something very similiar to the browse folder capability. This would allow me to support the following - A user would create a document on their server, then they would need to...
0
by: vbfoobar | last post by:
Hello, I am looking for Python code no other language wanted) that I couls use/reuse/adapt to implement (via CGI, no specific app server wanted) a web-based app that would offer the following...
4
by: DMG | last post by:
I have <identity impersonate = "true" /& <authentication mode="Windows"/in the web.config. This is a 2.0 site. My Goal: I want to simply have the user browse to a file on a mapped drive and get...
20
by: ram.rachum | last post by:
Hey, I'm looking for a good Python environment. That is, at least an editor and a debugger, and it should run on Windows. Does anyone have any idea?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.