|
-
Feb 14th, 2003, 03:40 PM
#1
Thread Starter
Junior Member
Comparing file names
I know how to bring up the contents of a folder and, I know how to fill a listbox by using a SQL statement. I don't know how to combine the two.
Here's the challenge. I'm trying to read file names from a listbox (which were filled after reading from a SQL field) and compare each one of them with entries from a file folder using the GetFiles object. The objective is to fill the listbox w/ file names that exist only in the folder and weed out the names that match in the SQL table. Ideas, anyone?
"Ignorance and prejudice and fear walk hand in hand" - 'Witch Hunt', by Rush
-
Feb 24th, 2003, 10:23 AM
#2
Junior Member
Reply
Why not just do a nested loop?
some psuedo code (or how ever its spelt)
Code:
for i = 0 to sqlfilename in the sql field
for x = 0 to dirfilename in directory
if sqlfilename(i) = dirfilename(x) then
ListBox1.Items.Add(sqlfilename(i))
end if
next
next
Never hit a man with glasses, hit him with a baseball bat instead.
-
Feb 24th, 2003, 11:10 AM
#3
Thread Starter
Junior Member
I did that, in a way. The problem was the program was writing each file name multiple times. I don't think I did it exactly the way you prescribed it, so I'll try it again to see if things turn out differently.
Oh, for future reference its 'pseudocode'.
Last edited by joethecool1; Feb 24th, 2003 at 11:46 AM.
"Ignorance and prejudice and fear walk hand in hand" - 'Witch Hunt', by Rush
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|