Microsoft.Jet.OLEDB.4.0 ado .net

J

jar

I am reading an excel sheet into a datareader or dataset and would like all
the columns be system.string. I'm using the following connect string:
Private xlPNSCon1 As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\My Documents\some.xls;" & _
'"Extended Properties=""Excel 8.0; HDR=YES; MaxScanRows=0; IMEX=1"""

Is there any option to make ado read the columns as strings?
 
J

jar

I'll answer my own question:
Set HDR=NO and MaxScanRows=1

It will read just the headings to detrmine data tpyes. The headers are text
fields.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top