Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Thanked 0 Times in 0 Posts

    Consecutive imports from multiple databases (Access 2000)

    I have a function that finds out if one of the databases exists, then imports the content of it, processes them and deletes it.
    Ususaly all of the 12 databases are present, and the function looks up for them, one after another, processes the content and then deletes the file.
    My question is, is it possible to name the paths in brackets, and then leave the function looks up for the databases one after another,
    imports the content from each database and then delete it?
    The function i use it now is as follows:

    Public Function Collect()

    ' first collect from History
    If Dir(DtHistory, vbNormal) <> "" Then
    Call FromDepot(DHistory)
    Kill (DHistory)
    End If

    If Dir(DSo, vbNormal) <> "" Then
    Call FromDepot(DSo)
    Kill (DSo)
    End If
    If Dir(DVa, vbNormal) <> "" Then
    Call FromDepot(DVa)
    Kill (DVa)
    End If

    etc etc

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Consecutive imports from multiple databases (Access 2000)

    You could create a procedure

    Public Sub CollectOne(strDatabaseName As String)
    If Dir(strDatabaseName, vbNormal) <> "" Then
    Call FromDepot(strDatabaseName )
    Kill strDatabaseName
    End If
    End Sub

    and call this procedure repeatedly in Collect:

    Public Function Collect()
    CollectOne DtHistory
    CollectOne DSo
    CollectOne DVa
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts