473,809 Members | 2,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2293
Cor
Hi Li,

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

"Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=C:\MyExc el.xls;Extended
Properties=""Ex cel 8.0;HDR=Yes;IME X=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.alt ria.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.microso ft.com/common/canned.aspx?R=d &H=Visual%20Bas ic%20.NET%20How %20To%20Article s&LL=kbvbnetSea rch&SZ=kbhowtom aster>

More information:

<news://news.microsoft. com/microsoft.publi c.excel.program ming>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
* "Li Pang" <an*******@disc ussions.microso ft.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
35569
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
2
9499
by: jeffgeorge | last post by:
I'm currently exporting a form to Excel. Because there are controls and totals in the header, I first have a button for users to convert to a datasheet. Then I use the automated quick office Export to Excel Link then I have a button which returns the user to a form view. It's a 3 step process with the user needing to Save As in Excel if they wish to keep the spreadsheet. Are there any other easier options? It seems I should be able...
5
8676
by: Igor | last post by:
Hi everyone! I have a question about exporting data to Microsoft Excel. I am writing program in C# and have to export some data to excel workbook. It works very good using OLE technology, but it requires Microsoft Excel installed on every machine with my program. It is not quite convenient to do so. Is there another way to export data to Excel, or how simply create file of Microsoft Excel format from my program (of cause, the format of...
3
3765
by: | last post by:
Hello, I have a routine in my Windows application that exports the contents of a datagrid to Excel. It is modeled closely after the HowTo example on MSDN: http://tinyurl.com/5g2jm. Depending on the number of rows/columns in the datagrid, it can be extremely slow (several minutes to populate a 1000x50 spreadsheet). That is understandable, looking at the number of steps to copy over just one row.
6
12600
by: Kevin Humphreys | last post by:
Hi There, I am trying to export a recordset to an excel file using the Content Type below in the header. Response.ContentType = "application/vnd.ms-excel" Which works fine however the problem is that when I have a number in a column with a leading zero the zero gets dropped.
9
22515
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What namespaces and classes should I use and how? -- dba123
9
1526
by: Paulo da Silva | last post by:
Hi. I have just seen that csv module, more exactly the Dialect class, does not have any variable to specify the "floating point" character! In portuguese this is ','. Not '.'. 3.1415 -3,1415. I think this is also the case of other languages/countries. If I am correct, i.e. if there is no such possibility, where can I file a request for a csv change? Excel, for example, automatically converts '.' to ',' and the separator from ',' to ';'.
2
2149
by: Dhananjay | last post by:
Hi all , I have got problem when i am tring to exportGridview Data into Excel format. It is going into text format ,but what i want is if the field is number/currency then it should go into number/currency format itself .Data exported to excel are all exported as text. Export to excel should maintain the formatting like numbers and money should be numbers and money in excel .
7
12082
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10643
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10391
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10121
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.