FileSystemObject "User Defined Type Not Defined" 
Author Message
 FileSystemObject "User Defined Type Not Defined"

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.*-*-*.com/
Before you buy.



Thu, 21 Nov 2002 03:00:00 GMT  
 FileSystemObject "User Defined Type Not Defined"
Nolan,

You need to set a reference to the Microsoft Scripting Runtime, SCRRUN.DLL.

You might also want to dimension a as Scripting.TextStream instead of
Object, to take advantage of early binding.

Simon Lewis

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.



Thu, 21 Nov 2002 03:00:00 GMT  
 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.


Fri, 22 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. "User defined type, not defined"

2. "Database - user defined type not defined"????

3. "User-defined type not defined"

4. User Control - User-defined type not defined

5. Error "User-define type not defined" While using New FileSystemObject Method

6. user-defined type not found - FileSystemObject

7. User Defined Type Not Defined

8. Compile Error: User-defined type not defined

9. User-defined type not defined (Access 97)

10. Excel : User-defined type not define

11. Compile Error - User defined type not defined

12. User-defined type not defined (Access 2000)

 

 
Powered by phpBB® Forum Software