473,394 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Importing from Excel

Amy
I have an ASP.NET (VB) routine that imports a lot of data from an Excel

spreadsheet into a OleDbDataAdapter, and then into a database table.
The import
has been working fine until now, but my latest spreadsheet has a column

that can be either completely numeric or alphanumeric. As long as the
first row contains alphanumeric everything is fine, but the latest
spreadsheet I received contained completely numeric data in the first
10 rows. This caused some of the alphanumeric data to not be read in.
I have been using IMEX=1 in my connection string which fixed this type
of situation I had when I first started working on this project, but it

doesn't seem to be working on this particular field.

Any suggestions?

Thanks,
Amy Bolden

Mar 31 '06 #1
4 1058
Amy
I was able to solve my problem by putting HDR=No in the connection
string. Then I insert the header text as the first record for the
field, thereby forcing Excel to make the field a string. This seems to
work well, although it is a little goofy.
Thanks,
Amy

Mar 31 '06 #2
Amy,

Could you please post your entire connection string? I have the same
problem, but when I added HDR=No to my connection string, I get "Unable
to find installable ISAM" on the Connection.Open method.

Thanks,
Terry
*** Sent via Developersdex http://www.developersdex.com ***
Mar 31 '06 #3
Nevermind. I figured out the connection string but it didn't solve my
problem.

I have an excel worksheet that i'm trying to read. One column contains
Customer ID's. Some are alpha numeric, some are numeric. The numeric
data doesn't get read in, even using Amy's suggestion.

5AC170
T99518
Y99887
6M9Z56
975219 <- All numeric, doesn't read in.
80090L
74Q248
0506XG

The connection string i'm using is:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ExcelFile.xls;Extended
Properties="Excel 8.0;HDR=Yes"

Using HDR=No doesn't work either.

Thanks for any help.

*** Sent via Developersdex http://www.developersdex.com ***
Mar 31 '06 #4
Hi Terry, I think you need to add IMEX=1 parameter in the Extended
properties of the connection string.

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\file.xls;Extended
Properties="Excel 8.0;IMEX=1;"

The only problem is that it converts the big numeric values to the format
9.9+e9, example 300015532 -> 3.00016e+008.

If you fix this problem please let me know
Regards
"Terry Olsen" wrote:
Nevermind. I figured out the connection string but it didn't solve my
problem.

I have an excel worksheet that i'm trying to read. One column contains
Customer ID's. Some are alpha numeric, some are numeric. The numeric
data doesn't get read in, even using Amy's suggestion.

5AC170
T99518
Y99887
6M9Z56
975219 <- All numeric, doesn't read in.
80090L
74Q248
0506XG

The connection string i'm using is:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ExcelFile.xls;Extended
Properties="Excel 8.0;HDR=Yes"

Using HDR=No doesn't work either.

Thanks for any help.

*** Sent via Developersdex http://www.developersdex.com ***

Jun 28 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Little PussyCat | last post by:
Hello, I nee to write something that will transfer excel data into an SQL Server table. I have for another database application I wrote have it importing Excel spreadsheet data using cell by...
9
by: Edward S | last post by:
I budget for a Project in an Excel sheet as illustrated below. The months below are usually a 2 year period i.e. 24 months, though it could be over 24 months depending upon a Project. I then...
7
by: Darren | last post by:
I have been attempting to create a reservation planning form in excel that imports Data from an Access database and inserts that information automaticly into the correct spreed sheet and the...
2
by: nutthatch | last post by:
I want to be able to import an Excel spreadsheet into Access 2K using the macro command Transferspreadsheet. However, the file I am importing (over which I have no control) contains some records...
9
by: jillandgordon | last post by:
I am trying to import an excel file into Access 97. It looks perfectly all right but, every time I try to import it, I get to the lst step and am told that it was not imported due to an error. ...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
2
by: jereviscious | last post by:
Hi all - Last resort time. I'm importing data from a spreadsheet that I receive from one of my vendor using interop.excel. The date field in excel is entered as 4/7/2006, but when I retrieve...
5
by: hharriel | last post by:
Hi, I am hoping someone can help me with an issue I am having with excel and ms access. I have collected data (which are in individual excel files) from 49 different school districts. All...
3
by: mukeshsrivastav | last post by:
dear sir i want to move form excel to access. i have 5 excel file having same formats and fields.now i want to import all data in one access table. importing one file is easy .but importing and...
28
by: kkadakia | last post by:
I get a daily excel file for a entire month which I want to transfer into Access at the end of the month. So, there are around 20-25 excel files I get by the end of the month, and I would like to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.