Reference Libraries- Access 2003

Evan_S

New member
Local time
Today, 18:13
Joined
Feb 25, 2005
Messages
8
I attempted use some code from an old project (Access 2000) in a
new project (Access 2003). The code uses "FileSearch" to search
a directory for specific files. It worked beautifully in my old project,
but seems to be ignored in Access 2003. I'm sure this has something
to do with the Reference Libraries, but I don't know which one.
I tried different combinations, but I can't find the correct one.

Can anyone point me in the right direction?
Thanks,
Evan
 
Depends on how you use it. If you're using any of the msoSomething constants, you'd need a reference to Microsoft Office N.M Object Library. (N.M -> 11.0 for 2003, I believe)

Often posting the offending code, highlighting the offending line, listing the errormessage makes it a bit easier to assist, else we're on a guessing tour...
 
Just go to your old project, look at what references were used... and make sure they're all checked in the new project.

Were you really serious about this post? If you're using the same references, make sure the orders are the same too as there is a system to judge priority of one reference over another.
 
Reference Libraries - Access 2003

The only difference are the versions. (i.e. MS Access 9.0 Object Library vs.
MS Access 11.0 Object Library). It wouldn't let met substitute earlier
version in Access 2003. The library order is the same.

Why did you doubt my seriousness?? It's a real issue.

Following is the problem code.

With Application.FileSearch
.NewSearch
.FileName = "*.txt"
.LookIn = "C:\"
.Execute
For Each varItem In .FoundFiles
rs2.AddNew
rs2.ListofFiles = varItem
varSaveChosenFilename = varItem
rs2.Update
Next varItem

End With
 
FileSearch works for me, how are you defining your recordset/varItems



edit:
tested A2K and A2K3
 
Last edited:
Works on my a2k3, varItem being declared as variant. Which line does it bomb on and what is the errormessage?
 
Dim db2 As Database, rs2 As Recordset
Set db2 = CurrentDb()
Set rs2 = db2.OpenRecordset("ListFiles")

Dim varitem as variant

---------------------------------
It doesn't bomb...no error messages.
It just doesn't find any files. It does
in Access 2002, but not in Access 2003.

I switched the code to use DIR(), and that works fine
so the pressure is off. I would just like to know
why it didn't work.

Thanks,
 

Users who are viewing this thread

Back
Top Bottom