Subj: Auto Export Access/Foxpr Section: Database Issues To: Shannon Rogers, 103424,3161 Wednesday, January 06, 1999 10:55:38 PM From: Calvin G. Smith, 102226,2127 #725466 Hi Shannon! >>> I'm trying to automate the export of a MS Access table to Foxpro using VB5. This export will take place several times a day and will run in the background. Can someone tell me if this is even possible and if not is there another way to accomplish this. I'm a beginner at VB and any help would be greatly appreciated. ... Below is the VBA code the macro outputted but I don't know how to compile it in VB. I have know idea if this technique can be accomplished. Any thoughts? ... DoCmd.TransferDatabase acExport ... <<< You're almost there. And yes, you actually can run MS Access macro actions (e.g. TransferDatabase, or whatever) from VB5. You just need to reference the MS Access 8.0 Object Library. The following function will help, which you can run from a Timer event: Calvin Smith http://www.CalvinSmithSoftware.com - Automation Code ----------------------------------------------------------------------------------- Sub ExportAccessTableToFoxProViaVB5() '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' 'Author: Calvin Smith 'Environment: MS VB v5.0 'WEB: http://www.CalvinSmithSoftware.com ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' '*** Reminder to reference the *** '*** MS Access v8.0 Object Library *** '*** prior to calling this sub-proc. *** ' On Error GoTo ExportAccessTableToFoxProViaVB5_Err Dim ac As Access.Application Set ac = New Access.Application ac.OpenCurrentDatabase (App.Path & "\MyDatabase.MDB") '*** Using your example *** ac.DoCmd.TransferDatabase acExport, "FoxPro 3.0", "C:\www\Tickets\", acTable, "AutoNumberPDF", "test.dbf", False ac.CloseCurrentDatabase ExportAccessTableToFoxProViaVB5_Exit: Exit Sub ExportAccessTableToFoxProViaVB5_Err: If Err Then 'Do whatever you need to here! Resume ExportAccessTableToFoxProViaVB5_Exit End If End Sub