Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 22nd, 2005, 05:56 AM
Registered User
Join Date: Feb 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems importing Excel into ADO.Net recordset

ok im trying to load an Excel spreadsheet into a recordset.

Im aware that Excel doesnt know what datatypes the columns of data are so it has a best guess by reading in 8 rows of each column.

Now the problem im having is that i have some columns iwth very little data in them and the ODBC driver seems to think that the column is Null so it doesnt import anything for that column. I can test this by sorting the spreadsheet on the column in question so that the few bits of data are at the top and they import fine, when i leave the spreadsheet unsorted the data doesnt import.

Now ive set the MaxScanRows property to 0 as this supposedly forces ODBC to check every row but still the data doesnt import. This is my connection string:

strSourceConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strFilename & ";Extended Properties='Excel 8.0;HDR=Yes;MaxScanRows=0'"

Then im just doing a "Select * from ......" to retreive the data.

Anyone know of a workaround? I dont really want to tell the users to resort the spreadheet on various columns to get all the data to import, id rather just have them press a single "Import" button.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get data from Excel file using ADO.NET lam_lvl ADO.NET 7 February 27th, 2014 05:19 AM
ADO.NET and Excel Theone84 ADO.NET 0 July 7th, 2008 05:20 AM
Clone DAO Recordset into ADO Recordset kamrans74 VB How-To 0 March 6th, 2007 11:57 AM
Update Excel File Using ADO .Net briancronin123 ADO.NET 0 June 3rd, 2004 02:20 AM
Convert ADO recordset to DAO recordset andrew_taft Access 1 May 5th, 2004 02:31 PM

All times are GMT -4. The time now is 05:29 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.