468,535 Members | 1,731 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,535 developers. It's quick & easy.

How to change Excel data format

I use sql to get the data from a Excel file. It works only
when the data within a column have the same data type. I'd
like to know how to change the data format for each column
(adding "'" for example) through whole data range? No VBA.

Thanks.
Nov 20 '05 #1
5 2131
Cor
Hi Li,

I saw this IMEX =1 once, never used it.

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended
Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
"HDR=Yes;" indicates that the first row contains columnnames, not data
"IMEX=1;" tells the driver to always read "intermixed" data columns as text
I hope this helps?

Cor
I use sql to get the data from a Excel file. It works only
when the data within a column have the same data type. I'd
like to know how to change the data format for each column
(adding "'" for example) through whole data range? No VBA.

Nov 20 '05 #2
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;194124
-----Original Message-----
I use sql to get the data from a Excel file. It works onlywhen the data within a column have the same data type. I'dlike to know how to change the data format for each column(adding "'" for example) through whole data range? No VBA.

Thanks.
.

Nov 20 '05 #3
Cor
Hi LI

DAO and a recordset?

Is this VB.net with that is more usual OleDB and a dataset.

Cor
Nov 20 '05 #4
* "Li Pang" <li*****@eu.altria.com> scripsit:
I use sql to get the data from a Excel file. It works only
when the data within a column have the same data type. I'd
like to know how to change the data format for each column
(adding "'" for example) through whole data range? No VBA.


Maybe Excel Automation?

Basic samples:

<http://support.microsoft.com/common/canned.aspx?R=d&H=Visual%20Basic%20.NET%20How%20To %20Articles&LL=kbvbnetSearch&SZ=kbhowtomaster>

More information:

<news://news.microsoft.com/microsoft.public.excel.programming>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
* "Li Pang" <an*******@discussions.microsoft.com> scripsit:
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;194124


Mhm... For VB6? Not for ADO.NET or whatever technology used with .NET.

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Allison Bailey | last post: by
2 posts views Thread by jeffgeorge | last post: by
5 posts views Thread by Igor | last post: by
3 posts views Thread by | last post: by
6 posts views Thread by Kevin Humphreys | last post: by
9 posts views Thread by dba123 | last post: by
9 posts views Thread by Paulo da Silva | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.