|
-
January 28th, 2000, 09:40 AM
#1
Converting a text file to a database
I hope someone could give me a sense of direction on this one. I have a text file that is tab delimited and I need to read this text file and put each item I read into a database. I also need to know what kind of format the VB app that I am writing should be in? ActiveX exe? Regular exe? etc as the VB program will run behind the scenes, so there will be no interface for it.
I will be using SQL Server as my database tool and I am using VB6 to write my code. Any help would be greatly appreciated!
-
January 28th, 2000, 09:56 AM
#2
Re: Converting a text file to a database
I would NOT write a VB app.
use the SQL Server tools to load your file, e.g. the bulk copy program (BCP) or DTS if you sqlserver is version 7 and above.
-
January 28th, 2000, 10:13 AM
#3
Re: Converting a text file to a database
Thanks, that sounds what I'm looking for but I'm not familiar with SQL Server all that much. I currently have a VB app that is already running and I was just going to make this new function a part of it. Since this app is running all the time, it will look for these text files every 5 minutes and put them in the database. Can VB call a SQL Server function to do this?
Sorry for making this long winded. P.S. I currently have 6.5 but I will have Ver 7.
-
January 28th, 2000, 10:17 AM
#4
Re: Converting a text file to a database
several solutions:
- use VB's Shell command to start the BCP-Utility
- use SQLDMO Komponent to programmatically invoke a BulkCopy process
- use ADO (activex Data objects) to connect to the database and do your inserts via the ADO object model (involves the most work).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|