Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 22nd, 2005, 05:56 AM
Registered User
 
Join Date: Feb 2005
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.








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





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