首先,请允许我说,我非常愿意在需要帮助时,在需要帮助提供代码方面有一个地方可以去。 当我看到有人试图提供帮助时,我甚至更感感谢。 因此,在座的各位都感谢你们看我的问题/问题,即使你们没有答案。
因此,关于我的问题/问题:
我试图让这工作, 但我似乎找不到语法错误!
谁能帮帮我...
这是代码:
dim strPathtoCSVFolder,strPathtoCSVFile,strPathtoCSVFileTWO
strPathtoCSVFolder="D:classic_asp est" & Request.QueryString("XTNO") & "Data"
strPathtoCSVFile="Unit_" & Request.QueryString("XTNO") & "_Year_" & Request.QueryString("year") & "_Q_" & Request.QueryString("q") & "_MERGE_DataCsv.csv"
strPathtoCSVFileTWO="Unit_" & Request.QueryString("XTNO") & "_Year_" & Request.QueryString("year") & "_Q_" & Request.QueryString("q") & "_MERGE_DataCsv_SORTED.csv"
Set Conn = CreateObject("ADODB.Connection")
Set RS = CreateObject("ADODB.Recordset")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPathtoCSVFolder & ";Extended Properties=""text;HDR=YES;FMT=Delimited"""
dim strDirInfoX
strDirInfoX="SELECT STATE, SUM(GALLONS) as Total FROM " & strPathtoCSVFile & " GROUP BY STATE "
response.write strDirInfoX
dim strTxttoMem
dim strsource
strsource="RS.Open " & strDirInfoX & " , Conn, 1, 3, &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, &H0001
Do Until RS.EOF
for i=0 to ubound(FieldNames)-1
response.write(FieldNames(i) & " = " & RS.Fields.Item(FieldNames(i)) & "<br>")
strTxttoMem=strTxttoMem & RS("STATE") & RS("total")
next
RS.MoveNext
Loop
RS.Close
Conn.Close
dim fs,tfile
set fs=Server.CreateObject("Scripting.FileSystemObject")
set tfile=fs.CreateTextFile(strPathtoCSVFolder & strPathtoCSVFileTWO)
tfile.WriteLine(strTxttoMem)
tfile.close
set tfile=nothing
set fs=nothing
非常感谢你的帮助...