Question : Load into SQL Server From FoxPro database through SSIS

I am having trouble loading Foxpro tables into SQL Server via SSIS.  I've created a connection in SSIS using the "Microsoft OLE DB Provide for Visual FoxPro" that is included with SSIS.  The test connection works properly and I can see the tables when I select from the Income Ole DB Provider in the data flow task. However, when I run the task, I get this error:


SSIS package "FFTest.dtsx" starting.
Information: 0x4004300A at Load CleanTransactions, DTS.Pipeline: Validation phase is beginning.
Error: 0xC0202009 at FFTest, Connection manager "\\maggie\loading\ff": SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040154.
An OLE DB record is available.  Source: "Microsoft OLE DB Service Components"  Hresult: 0x80040154  Description: "Class not registered".
Error: 0xC020801C at Load CleanTransactions, OLE DB Source [1]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "\\maggie\loading\ff" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Error: 0xC0047017 at Load CleanTransactions, DTS.Pipeline: component "OLE DB Source" (1) failed validation and returned error code 0xC020801C.
Error: 0xC004700C at Load CleanTransactions, DTS.Pipeline: One or more component failed validation.
Error: 0xC0024107 at Load CleanTransactions: There were errors during task validation.
Warning: 0x80019002 at FFTest: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "FFTest.dtsx" finished: Failure.


Then I decided to try and do this through ODBC instead of OLE DB.  So I tried installing the Visual Fox Pro driver (v 9.0 SP2) from the microsoft site.  It installs fine on my Windows 2008 64 bit server.  however when I go to create an ODBC connection, it does not show up in the drivers list.

I'm stumped.  Any help appreciated.

Answer : Load into SQL Server From FoxPro database through SSIS

the entry to the table should be in the format   i.e., 14:34:26,
to include the seconds here is a revised version

the tablename is TimeCard with a field  Daily Hours.

Function GetFlightTimeTotal()

 Dim db As DAO.Database, rs As DAO.Recordset
 Dim totalhours As Long, totalminutes As Long
 Dim days As Long, hours As Long, minutes As Long
 Dim interval As Variant, j As Integer

 Set db = DBEngine.Workspaces(0).Databases(0)
 Set rs = db.OpenRecordset("timecard")
 interval = #12:00:00 AM#
    While Not rs.EOF
       interval = interval + rs![Daily hours]
       rs.MoveNext
    Wend
 totalhours = Int(CSng(interval * 24))
 totalminutes = Int(CSng(interval * 1440))
 totalseconds = Int(CSng(interval * 86400))
 hours = totalhours Mod 24
 minutes = totalminutes Mod 60
 Seconds = totalseconds Mod 60

 GetFlightTimeTotal = totalhours & " hours and " & minutes & " minutes " & Seconds & " seconds"

 End Function
Random Solutions  
 
programming4us programming4us