"Bob Barrows [MVP]" wrote in message
news:...
: Roland Hall wrote:
: > "Roland Hall" <> wrote in message
: > news:...
: >> I have two(2) issues.
: <snip>
: >>
: >> Am I causing the issue myself or is this a known issue?
: >>
: Can you post a small extract from your csv file so we can attempt to
: reproduce this?
Here is a massaged record from the file:
999999,6232005,AD,3998717,TR,"KKKKKK, QQQQQQQ ",1111
SUENA ST , ,AUSTIN
,TX,71741,1111111111,1704866,EE,3071963,111111111,
, ,
,331.5,0,331.5,3091998,FAIL TO MAINTAIN FINANCIAL RESP ,OOOOOOOOOO &
OOOOO ,VRY11F ,TX,318,CHEV , ,BLU, ,N ,0, ,Y
It's fixed-length but also comma-delimited so I'm using comma-delimited.
This is my work-around since I get an extra record at the bottom:
for i = 0 to ubound(arrAccounts) - 1
This shows how the data gets read, folder is massaged. I changed my
connectionstring because HDR=NO was not working. I'm controlling it with
the schema.ini file.
dim conn, rs, strPath, arrAccounts, arr, count, records(), x
count = 0
set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
strPath = Server.Mappath("/somefolder/")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath & ";" &
"Extended Properties=Text"
rs.Open "SELECT DISTINCT case_num FROM austin.csv", conn, adOpenStatic,
adLockOptimistic, adCmdText
arrAccounts = split(rs.GetString(adClipString,,,,""),vbCr)
rs.Close
rs.Open "SELECT * FROM austin.csv", conn, adOpenStatic, adLockOptimistic,
adCmdText
arr = split(rs.GetString(adClipString,,vbTab,,"null"),vb Cr)
rs.Close
set rs = Nothing
conn.Close
set conn = Nothing
prt "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">"
prt "<html>"
prt "<body>"
removeDuplicates arrAccounts, arr
schema.ini file:
[austin.csv]
Format=CSVDelimited
ColNameHeader=False
Col1=personid Text
Col2=curr_date Text
Col3=trans_code Text
Col4=case_num Text
Col5=case_type Text
Col6=def_name Text
Col7=def_add1 Text
Col8=def_add2 Text
Col9=def_city Text
Col10=def_state Text
Col11=def_phone Text
Col12=def_zip Text
Col13=dl_num Text
Col14=dl_state Text
Col15=def_dob Text
Col16=ss_num Text
Col17=empl_name Text
Col18=empl_addr Text
Col19=empl_phone Text
Col20=ttl_due Text
Col21=ttl_paid Text
Col22=bal_due Text
Col23=issue_date Text
Col24=viol_desc Text
Col25=viol_place Text
Col26=plate_num Text
Col27=plate_st Text
Col28=plate_exp Text
Col29=vehi_make Text
Col30=vehi_model Text
Col31=vehi_color Text
Col32=conviction Text
Col33=status_cod Text
Col34=stats_date Text
Col35=bad_addr Text
Col36=adjudicated Text
I have the code working but I was only concerned about the HDR=NO not
working and the extra array element at the upper boundary.
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library -
http://msdn.microsoft.com/library/default.asp