
FileSystemObject "User Defined Type Not Defined"
Hours later,I think I may have found the answer in MS's Knowledge Base,
Article ID: Q202192. I had references set to both DAO and ADO and so
needed to specifically define WHICH one I was referring to. Only
Microsoft won't allow an apple to be an apple. You have to define
Live.apple versus Plastic_Fruit.apple.
Below the relevant KB text:
Example 1: DAO Objects
Reference: Microsoft DAO 3.6 Object Library
Declaration: Dim myRecordset as DAO.Recordset
Example 2: ADO Objects
Reference: Microsoft ActiveX Data Objects 2.1 Library
Declaration: Dim myRecordset as ADO.Recordset
NOTE: By explicitly declaring the object as ADO or DAO, the position of
the checked reference on the references list is not an issue.
Quote:
> I've just started with my first demo project in Access 2000. I'm
> trying to read and (eventually) parse a text file. So far I have the
> following and receive the above message about "user defined type not
> defined." I assume that this is a references problem of some sort,
but
> how do I figure out which Object Library this object is in?
> [I may just be cranky today, but it seems as though MS is making
Access
> HARDER to work with rather than easier. Were it not for the kind
> hearts and willing minds available here, I'd NEVER be able to complete
> some of my project. No thanks to MS :(
> It would seem to me that this should be a fairly basic object within
> Access 2000 and should be installed by default. Why is it not?]
> Sub Job_Offer_Parse()
> Dim fs As FileSystemObject
> Dim a As Object
> Dim retstring As String
> Set fs = CreateObject("Scripting.FileSystemObject")
> Set a = fs.OpenTextFile("d:\Personal\Text\20000601.txt",
> ForReading, False)
> Do While a.AtEndOfStream <> True
> retstring = a.ReadLine
> '...
> Loop
> a.Close
> End Sub
> TIA,
> Nolan Madson
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Sent via Deja.com http://www.deja.com/
Before you buy.