I hope someone can help with this. I'm trying to import a .dbf file with
VB6/DTS code.
I have written all the code and I can get it to work with .txt, .csv, xls
files but when I try a .dbf file I'm getting the err -2147220473, "The
connection for a task was not specified or was not found."
I can do it from DTS/SQL2000 without a problem. Then I save the DTS package
to a VB .bas file and run it, yes I changed the variables to reflect what I
did for the other file extensions, but it errors out.

Has anyone imported a .dbf file via code in VB? Is there something I'm missing?

Source Connection Sub
Public Sub DBFsource()

Set oConnection = goPackage.Connections.New("Microsoft.Jet.OLEDB.4.0 ")

oConnection.ConnectionProperties("User ID") = "Admin"
oConnection.ConnectionProperties("Data Source") = FileToImport
oConnection.ConnectionProperties("Extended Properties") = "dBase 5.0"
'FileToImport = path to file + filename.dbf
oConnection.Name = "dBase 5"
oConnection.ID = 5
oConnection.Reusable = True
oConnection.ConnectImmediate = False
oConnection.DataSource = FileToImport
oConnection.UserID = "Admin"
oConnection.ConnectionTimeout = 20
oConnection.UseTrustedConnection = False
oConnection.UseDSL = False

goPackage.Connections.Add oConnection
Set oConnection = Nothing

End Sub

Thanks in advance

Rob Vallee