Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
OleDB query to Excel returning Null values for numeric data
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ben Reese  
View profile  
 More options Mar 28 2007, 7:12 am
Newsgroups: microsoft.public.data.oledb
From: Ben Reese <BenRe...@discussions.microsoft.com>
Date: Wed, 28 Mar 2007 04:12:00 -0700
Subject: RE: OleDB query to Excel returning Null values for numeric data
Many thanks for your speedy reply Curtis. That worked a treat!

The extended property I required was IMEX=1
My connection string now looks like this:
Dim _cnn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=myFile.xls;Extended Properties=""Excel 8.0; IMEX=1""")

Thanks


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Todd  
View profile  
 More options Oct 18 2007, 10:40 am
Newsgroups: microsoft.public.data.oledb
From: Todd <T...@discussions.microsoft.com>
Date: Thu, 18 Oct 2007 07:40:02 -0700
Local: Thurs, Oct 18 2007 10:40 am
Subject: RE: OleDB query to Excel returning Null values for numeric data
Ben,
I am using the IMEX = 1 extended properties in my vb.net (VSTO 2003) code
and it is not over riding the the mixed type.  Here is the following code:

                MyConnection = New System.Data.OleDb.OleDbConnection( _
                      "provider=Microsoft.Jet.OLEDB.4.0;" & _
                      "Data Source=" & sFile & ";" & _
                      "Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";")

                ' Select the data from Sheet1 of the workbook.
                sItemSQL =  " Select * "
                sItemSQL += " From [item charts$]"

                MyCommand = New System.Data.OleDb.OleDbDataAdapter(sItemSQL,
MyConnection)

                DS = New System.Data.DataSet
                MyCommand.Fill(DS, "Item")

The result is giving only numeric information on my parts column and blank
when the part number starts with an alpha numeric.  Is there anything else I
have to do to get this to recogonize my mixed type column?

Thanks,

Todd


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Clement  
View profile  
 More options Oct 19 2007, 9:32 am
Newsgroups: microsoft.public.data.oledb
From: Paul Clement <UseAdddressAtEndofMess...@swspectrum.com>
Date: Fri, 19 Oct 2007 08:32:35 -0500
Local: Fri, Oct 19 2007 9:32 am
Subject: Re: OleDB query to Excel returning Null values for numeric data

On Thu, 18 Oct 2007 07:40:02 -0700, Todd <T...@discussions.microsoft.com> wrote:

¤ Ben,
¤ I am using the IMEX = 1 extended properties in my vb.net (VSTO 2003) code
¤ and it is not over riding the the mixed type.  Here is the following code:
¤
¤                 MyConnection = New System.Data.OleDb.OleDbConnection( _
¤                       "provider=Microsoft.Jet.OLEDB.4.0;" & _
¤                       "Data Source=" & sFile & ";" & _
¤                       "Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";")
¤
¤                 ' Select the data from Sheet1 of the workbook.
¤                 sItemSQL =  " Select * "
¤                 sItemSQL += " From [item charts$]"
¤
¤                 MyCommand = New System.Data.OleDb.OleDbDataAdapter(sItemSQL,
¤ MyConnection)
¤
¤                 DS = New System.Data.DataSet
¤                 MyCommand.Fill(DS, "Item")
¤
¤ The result is giving only numeric information on my parts column and blank
¤ when the part number starts with an alpha numeric.  Is there anything else I
¤ have to do to get this to recogonize my mixed type column?
¤

Probably will require a change to the Excel Registry setting TypeGuessRows:

http://dailydoseofexcel.com/archives/2004/06/03/external-data-mixed-d...

Paul
~~~~
Microsoft MVP (Visual Basic)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Todd  
View profile  
 More options Oct 19 2007, 10:06 am
Newsgroups: microsoft.public.data.oledb
From: Todd <T...@discussions.microsoft.com>
Date: Fri, 19 Oct 2007 07:06:03 -0700
Local: Fri, Oct 19 2007 10:06 am
Subject: Re: OleDB query to Excel returning Null values for numeric data
Paul,
Thanks for responding.  It seems like this is an issue with a lot of folks
out there.  I will not have access to edit everyone's registry.  This would
not be a viable solution for myself.  Any other solution that can be done
without editing any local machine settings?  I hate to open the excel file
and read it line by line.  Any other ideas?

Thanks,

Todd


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Clement  
View profile  
 More options Oct 23 2007, 11:03 am
Newsgroups: microsoft.public.data.oledb
From: Paul Clement <UseAdddressAtEndofMess...@swspectrum.com>
Date: Tue, 23 Oct 2007 10:03:22 -0500
Local: Tues, Oct 23 2007 11:03 am
Subject: Re: OleDB query to Excel returning Null values for numeric data

On Fri, 19 Oct 2007 07:06:03 -0700, Todd <T...@discussions.microsoft.com> wrote:

¤ Paul,
¤ Thanks for responding.  It seems like this is an issue with a lot of folks
¤ out there.  I will not have access to edit everyone's registry.  This would
¤ not be a viable solution for myself.  Any other solution that can be done
¤ without editing any local machine settings?  I hate to open the excel file
¤ and read it line by line.  Any other ideas?
¤

Unfortunately I'm not aware of another workaround for this.

Paul
~~~~
Microsoft MVP (Visual Basic)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yalin Meric  
View profile  
 More options Aug 26, 4:35 am
Newsgroups: microsoft.public.data.oledb
From: Yalin Meric <YalinMe...@discussions.microsoft.com>
Date: Wed, 26 Aug 2009 01:35:01 -0700
Local: Wed, Aug 26 2009 4:35 am
Subject: RE: OleDB query to Excel returning Null values for numeric data
First of all thanks for that useful information. I'd like to add a caution
about numeric fields in Excel though. The oledb adapter tends to convert
large numeric values to E representation (i.e. 4906945 to 4.906945E+006) and
this creates a mass if you are transferring the numeric data to a text field
(i.e. phone  number which may be written as +90(312)4906945 or simply 4906945
depending on users choice). Therefore if you are willing to have the exact
text entered to a cell in Excel you should set cell content type to Text
before entering and transferring data.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google