Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Fixed Width -> Database


Message #1 by "Craig Flannigan" <ckf@k...> on Wed, 22 May 2002 08:46:58 +0100
Hi,

I've got a load of text files which are created overnight from our main
system into Fixed-Width files. I have been asked to get these imported
automatically once the files are generated.

How do I get ASP to import a Fixed-width file automatically into a database
when each text file is different?

Excel/Access manages this easily from the Import menu but I need to do this
in ASP.

Can anyone point me in the right direction on this?

Regards
Craig


_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service on behalf of Kingfield Heath Ltd. For further information visit
http://www.star.net.uk/stats.asp
Message #2 by "Brian Lowe" <Brian.Lowe@i...> on Thu, 23 May 2002 01:15:32
> I've got a load of text files which are created 
> overnight from our main system into Fixed-Width 
> files. I have been asked to get these imported
> automatically once the files are generated.

> How do I get ASP to import a Fixed-width file 
> automatically into a database when each text file 
> is different?

> Excel/Access manages this easily from the 
> Import menu but I need to do this in ASP.

> Can anyone point me in the right direction on this?

If you've already done the work in Excel or Access, and have a macro or 
script there, why not use them?

Both Excel and Access expose themselves as COM objects and can be 
controlled programmatically by VBScript in your ASP page.

Of course if you've been using Excel or Access manually then you're no 
nearer.

Maybe you could use the FileSystemObject to open the file and read each 
line, then break it into fields based on your fixed widths, then use ADO 
to squirt the data into your db?

Brian Lowe
---------@

  Return to Index