[AccessD] FS object

John W. Colby jwcolby at colbyconsulting.com
Tue May 4 20:03:56 CDT 2004


There is a big difference.

The file system object comes with Windows (and internet explorer, and other
things).  Redemption I have to buy and install.

nuff said.

John W. Colby
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Brett Barabash
Sent: Tuesday, May 04, 2004 8:52 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] FS object


>Not sure exactly why.  It is just an object model that allows manipulation
>of the file system.  Why not hate DAO?  Why not hate the Excel object
model?
>Why not hate ...

This coming from the guy who refuses to use the Redemption DLL because it's
a COM object.

<vbg> Never a dull moment around here!


-----Original Message-----
From: John W. Colby [mailto:jwcolby at colbyconsulting.com]
Sent: Tuesday, May 04, 2004 7:49 PM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] FS object


>Have I said before I hate the FS object...

No doubt.

Not sure exactly why.  It is just an object model that allows manipulation
of the file system.  Why not hate DAO?  Why not hate the Excel object model?
Why not hate ...

Never mind.

It's just a tool.

John W. Colby
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Jürgen Welz
Sent: Tuesday, May 04, 2004 8:08 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] FS object


Have I said before I hate the FS object...

Public Function fnCreateBasePath(strCreatePath As String) As Boolean

    On Error GoTo ErrorHandler

Dim strPath As String
Dim lngPosition As Long

    strCreatePath = Trim(strCreatePath)
    If Right$(strCreatePath, 1) <> "\" Then strCreatePath = strCreatePath &
"\"
    lngPosition = 2
    Do Until lngPosition = 1
        lngPosition = InStr(lngPosition + 1, strCreatePath, "\")
        If lngPosition > 0 Then
            strPath = Left$(strCreatePath, lngPosition - 1)
            If Not Len(Dir(strPath, vbDirectory)) > 0 Then MkDir strPth
        End If
        lngPosition = lngPosition + 1
    Loop
    fnCreateBasePath = Len(Dir(strPath, vbDirectory))

ExitRoutine:
    On Error Resume Next
    Exit Function
ErrorHandler:
    With Err
        Select Case .Number
            Case Else
                MsgBox .Number & vbCrLf & .Description & vbCrLf & vbCrLf & _
                " Error in creating Folder:  '" & strCreatePath & "'", _
                vbInformation, "Error - fnCreateBasePath"
        End Select
    End With
    'Resume 0
    Resume ExitRoutine
End Function

Call it like so:

fncreatebasepath("C:\min\max\boo")

I culled this from some other work that I had done that had a guaranteed
fixed path so I was able to initialize lngposition at 22.  It formerly
worked with UNC and mappings but this is just a quick post without testing
because, as I said, I always had a fixed starting path.


Ciao
Jürgen Welz
Edmonton, Alberta
jwelz at hotmail.com


----------------------------------------------------------------------------
----------------------------------------
The information in this email may contain confidential information that
is legally privileged. The information is only for the use of the intended
recipient(s) named above. If you are not the intended recipient(s), you
are hereby notified that any disclosure, copying, distribution, or the
taking
of any action in regard to the content of this email is strictly prohibited.
If
transmission is incorrect, unclear, or incomplete, please notify the sender
immediately. The authorized recipient(s) of this information is/are
prohibited
from disclosing this information to any other party and is/are required to
destroy the information after its stated need has been fulfilled.

Any views expressed in this message are those of the individual
sender, except where the sender specifies and with authority,
states them to be the views of Tappe Construction Co.

This footer also confirms that this email message has been scanned
for the presence of computer viruses.Scanning of this message and
addition of this footer is performed by SurfControl E-mail Filter software
in conjunction with virus detection software.

--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list