Meshing VB with Access

Hierophant

Registered User.
Local time
Today, 13:36
Joined
Mar 14, 2003
Messages
28
Hi there,
Basically, I want some functionality in a simple mdb module which Access doesn't seem to support - ie, I want to write a nice recursive function to trash through a CD and record details about the files and folders in a relational db. Access 2k doesn't seem to like me trying to use FileSystemObjects. Can I include references to some VB library that will then let me use full VB in Access modules? If so, what do I reference?

If writing the code in a module incorporated into an mdb file is not possible, what would be the simplest way of achieving my goals? I suspect writing some VB and calling it externally to the mdb, but I've no experience with VB, and I am not sure exactly how VB modules, Access, etc, all mesh together.

Any info/advice would be greatly appreciated!

Cheers, Luke.

Btw, I've chosen to write this little application to catalogue and make easy to search my huge CD collection, full of files which are individually hard to find. I chose to look into using MS Access as the db and interface, because I thought it would be simple to work out some VB that at a click churns through a CD. I still think this is the easiest approach, as opposed to writing it in Java or C++ and bothering with DB/SQL related libraries etc. Agree?
 
the FSO should work fine. I've used it in access and have had no problems. what problems are you running into?
 
I get error messages along the lines of "User-defined type not found" when it encounters declaration of a FSO.

I know this means I'm not referencing the appropriate VB library, but I'm not sure which one to check. Perhaps my machine doesn't have the full VB library by default, and I need to dl it?


Luke
 
Luke,

What you want is entirely possible.

Use the search Facility here and look for "references".

Wayne
 
Wayne, Rachaels post is interesting, but not really related to my problem.
I have a referencing problem.
I have a standard winXP install with standard MSAccess2k install, and standard references ticked.

When I declare a simple instance of a FileSystemObject, I get the message,

"User-defined type not defined", clearly indicating I do not have the proper library referenced to use this (and probably a lot of other) types.

I'd like to know exactly what .dll or other library I need referenced to allow me to use this FileSystemObject type.

Hope you can help!

Cheers, Luke
 
Luke,

Get your code in Design View.
Tools --> References
Select: Microsoft Scripting Runtime

Then compile. You should be OK.

Wayne
 
Cheers Wayne, works beautifully.

I can now declare FSO objs, and Folder objs etc..

One object still can't be declared - another "User-defined type not def".

This may not matter - the type is 'Node'.. ie
Dim target_node As Node

I assume this is used in tree operations, and I don't think I will need to use this type actually.

Thanks again.

Luke

ps. are there any good free VB ides out there?
 
Actually, something I'd be very interested to know is whether I am on the right track at all with this:

I wish to access a CD drive, and process the files/folders within the CD. Can I get easy access to the D drive say, through an FSO?

As in..
Dim fso As FileSystemObject
Dim target_folder As Folder
Set fso = New FileSystemObject
Set target_folder = fso.GetFolder("D:/")

Or something similar? Any resources on this would be great - as you've probably guessed by now, I'm under-resourced. :)

Cheers again,
Luke
 
Luke,

I've always used the Dir() command. I find it much easier. I know there
have been plenty of posts here.

Search for "Dir AND ghudson", I know you'll find something.

Wayne
 
Hierophant said:
One object still can't be declared - another "User-defined type not def".

This may not matter - the type is 'Node'.. ie
Dim target_node As Node

I assume this is used in tree operations, and I don't think I will need to use this type actually.
I think you should also reference the mscomct2.ocx (Microsoft Common Controls), which contains the treecontrol?
 

Users who are viewing this thread

Back
Top Bottom