Yes, by default, the JET OLEDB text driver (used for CSV files) only scans the first 8 rows or your table and decides what the type of your data based on that. If it only sees numbers in those first 8 rows, then that column *will* be treated as a number.
There's a long answer and a short answer.
The short answer: If your table has a HEADING row with the names of the columns, then lie to JET: Tell it that the table does *NOT* have a heading row. Now it will treat that first row as data. It will see the name in the first row and so every column will now be text type. You will no longer be able to use RS("columnname") in your ASP code, of course. Instead, you will have to use RS(0), RS(1), etc. Getting the columns by number instead of name. You can do this by just changing your connection string:
Code:
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\;" & _
"Extended Properties=""text;HDR=No;FMT=Delimited"""
The longer answer: It's shorter for me, longer for you. <grin/> Look here:
http://support.microsoft.com/kb/210073/EN-US/
You will need to create a "schema.ini" file in the same directory as the "csv" file.
I *think* all you would need would be
Code:
[YourFileName.csv]
ColNameHeader=True
Format=Delimited
MaxScanRows=9999
Might be able to use 0 for MaxScanRows. Dunno.