Re: How do I list files in directory?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: kyote (truthowl_at_NOSPAM.charter.net)
Date: 04/02/04


Date: Fri, 02 Apr 2004 01:11:15 -0600

On Thu, 1 Apr 2004 22:37:36 -0500, "MikeD" <nobody@nowhere.edu> wrote:

>
>"kyote" <truthowl@NOSPAM.charter.net> wrote in message
>news:p0kp60toavhqs61rib0scempd66vu5nr3i@4ax.com...
>> Which control do I use to list files in a directory? Listbox? I'm not
>> connecting to a DB I just want to list every file in a given
>> directory. I just want to know which control's to use, not how to do
>> it. I've realized that I'm jumping wayyy to far ahead of myself by
>> trying to understand ADO and such when my understanding of VB's basics
>> is still very unstable. So I'm wanting to platy around with this. Can
>> someone tell me which controls I need? Please? This isn't for work or
>> school for time isn't critical. Thanks in advance!!
>
>
>You ARE really lost. It's got nothing to do with ADO. ADO stands for
>"ActiveX Data Objects". It's used for accessing data in databases. Getting
>a list of files in a directory has NOTHING to do with databases. VB has an
>intrinsic control for listing files in a given directory. It's called a
>FileListBox. Generally speaking, you shouldn't use it because it's very
>antiquated, but VB provides no other intrinsic alternative. To use the more
>"modern" Explorer-style list of files and/or folders, you need to write it
>yourself using the Treeview and ListView controls.

Ouch! I re-read what I posted and it does look like I was considering
ADO for listing files in a directory. Sorry about that Mike. What I
meant is, I've been playing around with VB trying to learn it by
experience. I wanted to create simple little apps that were useful in
helping me learn VB. But I was trying to work with ADO and I kept
getting severely frustrated as you pointed out below. That kept making
me think I chose the wrong career... So I finally decided I needed to
learn to walk before I try to run.

>However, since you're apparently very new to VB, you need to learn the
>basics of the language first. Therefore, you should probably use VB's
>FileListBox (otherwise, you'll just be trying to learn too much at once, get
>overwhelmed by it, and won't learn anything). You'll find it in the Toolbox
>window. Consult VB's Help on its properties, methods, and how to use it.

I was considering Treeview but the tutorials I googled up were still
beyond me. Thanks for the advice. I'm using Drive/Dir/FileListBox's
and my confidence is improving noticeably. Even my excitement over
coding is improving. God Bless You!

And thank you to Larry and Ruskin too!! Ruskin your little code
snippet got me on the right track immediately. Thank you. And Larry, I
almost always use the search feature and had rarely considered using
the Index. Thank you for that advice as well, which, I think, will be
useful even away from VB.

-------
Kyote.sends("Greetings");



Relevant Pages

  • Re: VB6 Winsock action on Server
    ... With the introduction on your part of ADO and DBMS. ... to be used to connect and manage data flow between client and DB? ... I think the issue is namely how to control concurrent access. ...
    (microsoft.public.vb.general.discussion)
  • Re: VB6 - Using Unbound Controls
    ... The VB6 Forms use Data Controls and ADO. ... I've developed Access Apps w/ Unbound ... Controls using DAO for almost 6 years, ... selected data from the Field data saved by the Data Control in the VB6 ...
    (microsoft.public.vb.general.discussion)
  • Re: ADO control and SQL Session
    ... In my testing, if I open a VBA form with ADO control, sp_who ... I closed the form,reopen it, the number of sql session ... I close the ADO record set connection ...
    (microsoft.public.vb.controls)
  • Re: -2147467259 Unspecified Error
    ... With ADO "classic" you don't have as much control. ... you might try changing the Connection string (change the ... "Terry" wrote in message ...
    (microsoft.public.data.ado)
  • Re: Thanks Harry
    ... "Larry" wrote in message ... > Or you could just simply talk boats and not worry about it. ... most of the medical financial stuff Harry uses against me was ... I'll be watching herring to see how he behaves and what efforts he makes to *try* to control his ID spoofing buddies. ...
    (rec.boats)