Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Import Text Files


Message #1 by "Mark Irvine" <mark@m...> on Tue, 21 Aug 2001 21:45:39
Hi,



I am working on a small project that requires data to be imported from a

structured text file (*.txt), however is there anyway to build an automated

procedure that will allow the user to browse to the file, select it and 

then

click a button and import the data.  It would also be nice if a form could

be built that would also upload the database to an FTP address.  I know 

this

can be done, but am unsure how to go about it - any suggestions would be

appreciated.



Mark
Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Tue, 21 Aug 2001 14:32:39 -0700
Automating imports is surely possible.  I believe there's code on

http://www.mvps.org/access/ for displaying a File Open dialog to get the

path & name of a file to import from.  When you've got that, use

DoCmd.TransferText with a saved file specification to do the actual import.

If you're using A2K, be sure to heed the KB article at



http://support.microsoft.com/support/kb/articles/Q245/4/07.ASP



As for the FTP'ing, that I'm not sure about.  There's an activex control

that comes with VB that does FTP (the internet transfer control) but using

activex controls in Access can be tough--they are not all compatible.  There

are also API calls you could make (the routines are in WinInet.dll) but

that's as far from user-friendly as windows programming gets.



Probably the easiest thing to do would be to use the command-line FTP client

that comes with windows, along with a script file.  The script file is plain

text & contains the commands you would otherwise be entering manually at the

command prompt.  For instance:



Open MyFTPSite.MyServer.com

RPardee

Password

lcd c:\MyAccessFiles\

cd /ServerDir

Binary

put MyMDB.mdb

bye



If you were to save these commands in a text file called SendMDB.ftp, you

could kick off the process with the call:



FTP -sSendMDB.ftp



Which can be put in a batch file or windows script; scheduled to run on a

regular basis, etc.



HTH,



-Roy



-----Original Message-----

From: Mark Irvine [mailto:mark@m...]

Sent: Tuesday, August 21, 2001 2:45 PM

To: Access

Subject: [access] Import Text Files





Hi,



I am working on a small project that requires data to be imported from a

structured text file (*.txt), however is there anyway to build an automated

procedure that will allow the user to browse to the file, select it and 

then

click a button and import the data.  It would also be nice if a form could

be built that would also upload the database to an FTP address.  I know 

this

can be done, but am unsure how to go about it - any suggestions would be

appreciated.



Mark





Message #3 by "Mark Irvine" <markpirvine@b...> on Wed, 22 Aug 2001 09:49:56 +0100
Roy,



Many thanks for you reply.  I think I will turn my attention away from

integrating FTP from within Access, and use the FTP facility in windows.



Mark



Mark

Pardee, Roy E <roy.e.pardee@l...> wrote in message news:95480@a...

>

> Automating imports is surely possible.  I believe there's code on

> http://www.mvps.org/access/ for displaying a File Open dialog to get the

> path & name of a file to import from.  When you've got that, use

> DoCmd.TransferText with a saved file specification to do the actual

import.

> If you're using A2K, be sure to heed the KB article at

>

> http://support.microsoft.com/support/kb/articles/Q245/4/07.ASP

>

> As for the FTP'ing, that I'm not sure about.  There's an activex control

> that comes with VB that does FTP (the internet transfer control) but using

> activex controls in Access can be tough--they are not all compatible.

There

> are also API calls you could make (the routines are in WinInet.dll) but

> that's as far from user-friendly as windows programming gets.

>

> Probably the easiest thing to do would be to use the command-line FTP

client

> that comes with windows, along with a script file.  The script file is

plain

> text & contains the commands you would otherwise be entering manually at

the

> command prompt.  For instance:

>

> Open MyFTPSite.MyServer.com

> RPardee

> Password

> lcd c:\MyAccessFiles\

> cd /ServerDir

> Binary

> put MyMDB.mdb

> bye

>

> If you were to save these commands in a text file called SendMDB.ftp, you

> could kick off the process with the call:

>

> FTP -sSendMDB.ftp

>

> Which can be put in a batch file or windows script; scheduled to run on a

> regular basis, etc.

>

> HTH,

>

> -Roy

>

> -----Original Message-----

> From: Mark Irvine [mailto:mark@m...]

> Sent: Tuesday, August 21, 2001 2:45 PM

> To: Access

> Subject: [access] Import Text Files

>

>

> Hi,

>

> I am working on a small project that requires data to be imported from a

> structured text file (*.txt), however is there anyway to build an

automated

> procedure that will allow the user to browse to the file, select it and

> then

> click a button and import the data.  It would also be nice if a form could

> be built that would also upload the database to an FTP address.  I know

> this

> can be done, but am unsure how to go about it - any suggestions would be

> appreciated.

>

> Mark

>

>

>

>





Message #4 by "Mike" <mike.day@o...> on Thu, 23 Aug 2001 17:00:45
> Hi,

> 

> I am working on a small project that requires data to be imported from a

> structured text file (*.txt), however is there anyway to build an 

automated

> procedure that will allow the user to browse to the file, select it and 

> then

> click a button and import the data.  It would also be nice if a form 

could

> be built that would also upload the database to an FTP address.  I know 

> this

> can be done, but am unsure how to go about it - any suggestions would be

> appreciated.

> 

> Mark



If you want to import a file, use the common dialog activex contol. this has ShowOpen etc and will 

provide the user with what you need



 

  Return to Index