🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.bazy-danych.msaccess
Article #137341

Re: export kwerendy do pliku csv

#137341
From: MaciejF
Date: Thu, 01 Dec 2016 08:05
25 lines
2396 bytes
Jeżeli dobrze zrozumiałem Jana to chciałby zrzucić wynik kwerendy do pliku csv.
Może najpierw utwórz tabelę tymczasową tmpTmpExpDPD.
I z niej zrzucaj do pliku csv tak jak napisał Zbigniew Bratko.
Popracuj nad prawidłową specyfikacją eksportu.
Dla uproszczenia tylko 3 pola.


strDel = "DELETE * FROM tblTmpExpDPD"

strINS = "INSERT INTO tblTmpExpDPD (S_Name, S_Address, S_Zip) SELECT FIRMA.Nazwa AS S_Name, FIRMA.Ulica AS S_Address, FIRMA.Kod AS S_Zip FROM FIRMA, [Export DPD2] WHERE ((([Export DPD2].Wydrukowane)=2));" 

DoCmd.Execute strDel
DoCmd.Execute strINS


Dim strFullPath As String 
Const conFileNameCSV As String = "TestCsv.csv" 
Const conTblName As String = "tblTmpExpDPD" 
Const conSpecyficationName As String = "MojaSpecyfikacja" 

   strFullPath = CurrentProject.Path & "\" & conFileNameCSV 
   DoCmd.TransferText acExportDelim, conSpecyficationName, conTblName, 
strFullPath, True 

MF
Technical Details
Message-ID: <a2f903f1-dea0-4de3-9cb8-7fc139b2df9d@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin2!goblin.stu.neva.ru!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!n6no665061qtd.0!news-out.google.com!j8ni2484qtc.0!nntp.google.com!n6no665057qtd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <39d994b6-e28e-4fc2-a084-f06f776fd643@googlegroups.com> <o1ncda$qom$1@node2.news.atman.pl> <o1nfag$hsc$1@node1.news.atman.pl>

Show Full Headers
Complete Article Headers
X-Received: by 10.176.7.66 with SMTP id h60mr13888362uah.30.1480579510316;        Thu, 01 Dec 2016 00:05:10 -0800 (PST)
X-Received: by 10.157.11.248 with SMTP id 111mr2316782oth.4.1480579510277; Thu, 01 Dec 2016 00:05:10 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin2!goblin.stu.neva.ru!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!n6no665061qtd.0!news-out.google.com!j8ni2484qtc.0!nntp.google.com!n6no665057qtd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.bazy-danych.msaccess
Date: Thu, 1 Dec 2016 00:05:09 -0800 (PST)
In-Reply-To: <o1nfag$hsc$1@node1.news.atman.pl>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=213.241.94.194; posting-account=kc7ZIQoAAAB5PkdJgxjq1dd8jnBK4MVp
NNTP-Posting-Host: 213.241.94.194
References: <39d994b6-e28e-4fc2-a084-f06f776fd643@googlegroups.com> <o1ncda$qom$1@node2.news.atman.pl> <o1nfag$hsc$1@node1.news.atman.pl>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a2f903f1-dea0-4de3-9cb8-7fc139b2df9d@googlegroups.com>
Subject: Re: export kwerendy do pliku csv
From: MaciejF <maciejfr@onet.pl>
Injection-Date: Thu, 01 Dec 2016 08:05:10 +0000
X-Received-Bytes: 2231
X-Received-Body-CRC: 898058312
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit