>Thanks Hector
>
>I figured as much. I'll just write my own, again. It won't be bad. I've actually done it 3 times in VFP, and I've got the process down pretty well. It's just a tedious task!
>
>
>
David,
I have found that using the Jet ODBC text driver makes it easier to coerce text files into a format with standard field names and widths. For instance, I store the different source formats in an SQL table - assuming there will be a finite set of formats - and generate a schema.ini file on the fly. See
http://support.microsoft.com/default.aspx?scid=kb;en-us;149090 for a sample schema.ini file.
After writing the schema.ini file to the same directory as the text file, I use the OleDb DataReader to SELECT all of the rows and call the appropriate INSERT stored procedures to get them into SQL Server.
A slightly heavier method would be to create a strongly-typed DataSet that is based on the destination table. Then you could Fill the DataSet with the OleDb connection and Update the DataSet with a SQL connection.