Re: ADO with Excel using .csv? (VB6-Pro)
- From: "Frustrated Again" <NoSpam@xxxxxxxxxx>
- Date: Tue, 13 Sep 2005 00:57:19 -0700
Paul Clement (VB MVP) on the microsoft.public.vb.database.ado forum found
the error of my ways (thanks again, Paul, if you happen to see this in this
forum).
I had misunderstood how to do it as explained at
http://support.microsoft.com/default.aspx?scid=kb;EN-US;257819
and had stipulated a connection string as:
strcon = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & csvFile & ";" & _
"Extended Properties=""Excel 2002;IMEX=1;HDR=YES"""
It should instead read:
strcon = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & csvFile & ";" & _
"Extended Properties=""Excel 8.0;IMEX=1;HDR=YES"""
The code then worked with a .xls type file just fine, I could iterate
through all the rows and columns, but it still won't work with a .csv export
of the same file, and gives a "Run-time error -2147467259 (80004005)
External table is not in the expected format." response. But the same .csv
file will load into Excel just fine if I double-click the .csv file, no
parsing errors are then apparent. I'm going to try to get around this by
using automation to make Excel itself load the .csv file and then to save it
as a normal .xls type file so that I can then use the above connection
string to move the Excel "records" over into Access. Unless someone can tell
me how to make the above connection string work with a .csv file, that is!
.
- Follow-Ups:
- Re: ADO with Excel using .csv? (VB6-Pro)
- From: Daniel Crichton
- Re: ADO with Excel using .csv? (VB6-Pro)
- References:
- ADO with Excel using .csv? (VB6-Pro)
- From: Frustrated Again
- ADO with Excel using .csv? (VB6-Pro)
- Prev by Date: Securing database in code
- Next by Date: Re: ADO with Excel using .csv? (VB6-Pro)
- Previous by thread: ADO with Excel using .csv? (VB6-Pro)
- Next by thread: Re: ADO with Excel using .csv? (VB6-Pro)
- Index(es):
Relevant Pages
|
|