Re: saving to a csv file
- From: <arch>
- Date: Wed, 11 May 2005 22:16:10 +0800
Thanks. But what I really wanted was to have a listbox that contains a list
of queries that a user selects, and then presses a button and then he is
walked through selecting a filename to save to etc. Is there an easier way?
Is there a way to use Runcommand, like with the import wizard, or something
similar?
"Alex White MCDBA MCSE" <alex@xxxxxxxxxxxxxx> wrote in message
news:OZJj66iVFHA.3076@xxxxxxxxxxxxxxxxxxxxxxx
> So you have a listbox or something with a resultset that you want to
export
> to a text file
>
> dim adoTest as new adodb.recordset
> with adoTest
> .open me.lstResults.rowsource, currentproject.connection,
adOpenKeyset,
> adLockReadOnly
> if .recordcount > 0 then
> Open "c:\MyExported.txt" For Output As #1
> do while not .eof
> write #1, .fields("myFirstField").value,
> .fields("mySecondField").value
> .movenext
> loop
> close #1
> end if
> end with
>
> one comma seperated file......
>
> --
> Regards
>
> Alex White MCDBA MCSE
> http://www.intralan.co.uk
>
> <arch> wrote in message news:42820147$1@xxxxxxxxxxxxxxxxxxxxxx
> > Hi. I'm using Access 2000 and I'm having trouble trying to create some
> > vba
> > code that will allow me to save the data in a query to a csv file (comma
> > separated text). I used the acCmdImport command to import the data file
> > originally. However, I don't know how to export it (preferably with a
gui
> > to allow the user to enter a filename to save to). Please provide
sample
> > code.
> >
> >
> >
> >
>
>
.
- Follow-Ups:
- Re: saving to a csv file
- From: Alex White MCDBA MCSE
- Re: saving to a csv file
- References:
- saving to a csv file
- From: arch
- Re: saving to a csv file
- From: Alex White MCDBA MCSE
- saving to a csv file
- Prev by Date: multiple criteria search page
- Next by Date: Re: multiple criteria search page
- Previous by thread: Re: saving to a csv file
- Next by thread: Re: saving to a csv file
- Index(es):
Loading