Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
;Winbatch 2006C - write rows to csv file in chunks ; useful for large queries (millions of rows) ; ;Stan Littlefield June 21, 2006 ;////////////////////////////////////////////////////////////////// ;substitute your own datasource and provider cMDB=StrCat(DirScript(),"wmi.mdb") If ! FileExist(cMDB) Then Exit cOut=StrCat(DirScript(),"wmi.csv") If FileExist(cOut) Then FileDelete(cOut) cConn = "Provider=MicroSoft.Jet.OLEDB.4.0; Data Source=%cMDB%" oRS = CreateObject("ADODB.Recordset") oRS.CursorLocation=3 ;adjustable number of records per page nRecs = 40 oRS.CacheSize = nRecs ;basic forward-only cursor, substitute for your datasource oRS.Open("SELECT * FROM Classes",cConn,0,1,1) ;hopefully your provider supports this rCount = oRS.RecordCount nPos=1 oRS.MoveFirst() h=FileOpen(cOut,"WRITE") IntControl(53,0,0,0,0) While (nPos<=rCount) && !oRS.eof FileWrite( h,oRS.GetString(2,nRecs,",",@CRLF,"") ) nPos=nPos+nRecs EndWhile :End oRS.Close() FileClose(h) oRS=0 Exit ;/////////////////////////////////////////////////////////////
Article ID: W17113
File Created: 2007:07:03:14:28:20
Last Updated: 2007:07:03:14:28:20