• Consecutive imports from multiple databases (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Consecutive imports from multiple databases (Access 2000)

    Author
    Topic
    #398593

    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)
    ProcessTables
    Kill (DHistory)
    End If

    If Dir(DSo, vbNormal) “” Then
    Call FromDepot(DSo)
    ProcessTables
    Kill (DSo)
    End If
    If Dir(DVa, vbNormal) “” Then
    Call FromDepot(DVa)
    ProcessTables
    Kill (DVa)
    End If

    etc etc

    Viewing 1 reply thread
    Author
    Replies
    • #763377

      You could create a procedure

      Public Sub CollectOne(strDatabaseName As String)
      If Dir(strDatabaseName, vbNormal) “” Then
      Call FromDepot(strDatabaseName )
      ProcessTables
      Kill strDatabaseName
      End If
      End Sub

      and call this procedure repeatedly in Collect:

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

    • #763378

      You could create a procedure

      Public Sub CollectOne(strDatabaseName As String)
      If Dir(strDatabaseName, vbNormal) “” Then
      Call FromDepot(strDatabaseName )
      ProcessTables
      Kill strDatabaseName
      End If
      End Sub

      and call this procedure repeatedly in Collect:

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

    Viewing 1 reply thread
    Reply To: Consecutive imports from multiple databases (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: