Note that there are some explanatory texts on larger screens.

plurals
  1. POReading CSV in Recordset?
    primarykey
    data
    text
    <p>Let me start off by saying that I am very greatful to have a place to go to when I need help with some code and I'm even more thankful when I see people trying to help out, so for everyone here Thank you for looking at my question/problem even if you don't have an answer.</p> <p>With that said, on with my question/problem:</p> <p>I have been trying to get this to work but I cannot seem to find the syntax error!! :-(</p> <p>Can anyone please help me...</p> <p>Here is the code:</p> <pre><code>dim strPathtoCSVFolder,strPathtoCSVFile,strPathtoCSVFileTWO strPathtoCSVFolder="D:\classic_asp\test\" &amp; Request.QueryString("XTNO") &amp; "\Data\" strPathtoCSVFile="Unit_" &amp; Request.QueryString("XTNO") &amp; "_Year_" &amp; Request.QueryString("year") &amp; "_Q_" &amp; Request.QueryString("q") &amp; "_MERGE_DataCsv.csv" strPathtoCSVFileTWO="Unit_" &amp; Request.QueryString("XTNO") &amp; "_Year_" &amp; Request.QueryString("year") &amp; "_Q_" &amp; Request.QueryString("q") &amp; "_MERGE_DataCsv_SORTED.csv" Set Conn = CreateObject("ADODB.Connection") Set RS = CreateObject("ADODB.Recordset") Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &amp; strPathtoCSVFolder &amp; ";Extended Properties=""text;HDR=YES;FMT=Delimited""" dim strDirInfoX strDirInfoX="SELECT STATE, SUM(GALLONS) as Total FROM " &amp; strPathtoCSVFile &amp; " GROUP BY STATE " '''''' response.write strDirInfoX dim strTxttoMem dim strsource strsource="RS.Open " &amp; strDirInfoX &amp; " , Conn, 1, 3, &amp;H0001" RS.Open strsource 'response.write strsource redim FieldNames(rs.fields.count) redim FieldTypes(rs.fields.count) For i = 0 To (rs.Fields.Count - 1) FieldNames(i) = cstr(trim(rs.Fields.Item(i).Name)) FieldTypes(i) = cstr(trim(rs.Fields.Item(i).Type)) Next RS.Close RS.Open strDirInfoX, Conn, 3, 3, &amp;H0001 Do Until RS.EOF '''' for i=0 to ubound(FieldNames)-1 ''' response.write(FieldNames(i) &amp; " = " &amp; RS.Fields.Item(FieldNames(i)) &amp; "&lt;br&gt;") strTxttoMem=strTxttoMem &amp; RS("STATE") &amp; RS("total") '' next RS.MoveNext Loop RS.Close Conn.Close dim fs,tfile set fs=Server.CreateObject("Scripting.FileSystemObject") set tfile=fs.CreateTextFile(strPathtoCSVFolder &amp; strPathtoCSVFileTWO) tfile.WriteLine(strTxttoMem) tfile.close set tfile=nothing set fs=nothing </code></pre> <p>Thank you so much for any help...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload