Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import Text file to SQL using VB6 1

Status
Not open for further replies.

barbola

Technical User
Feb 27, 2003
1,132
CA
I am replacing an old Perl program that splits up a text file and imports it into a couple of tables in a SQL database, and also has to perform some calculations for other fields in the table.

The text file has one line per detail record, and is always the same, so this should be easy right?

I'm not quite sure where to start on this project. I have a similar application I developed (sort of) that imports an excel sheet, but I had alot of help on Tek Tips with this one as well, but it's just ... different...

The tables are basically Master and Detail. There could be a couple hundred detail records and then I need to also create a master record for the detail based on some grouping options. I know how to do the SQL stuff, but the VB code gets me every time.

thanks.
 
Well, you're importing in to a temp table but not really doing anything with it yet, so... no harm in playing, right.

Try modifying the input file so that there is only a couple rows, then import it. Does it work? Add more data, import it, etc... If you have bad data, then you should be able to track it down using this technique. Hope it helps.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
I tested it with the exact same 3 records as above, and also with the real file. I still get that collation invalid error.

The ABCCO records above is from the data file, only I changed the company name and some numbers.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top