LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.dotnet.framework.odbcnet,microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default ODBC and Excel

Hello,

I am using the following connection to Query and Excel Spreadsheet:

AConnectionString = "Driver={Microsoft Excel Driver
(*.xls)};DriverId=790;Dbq=" & ofdSelectFile.FileName & ";DefaultDir=c:\;"

ASourceConnection = New Odbc.OdbcConnection(AConnectionString)

Dim ADataAdapter as new odbc.odbcDataAdapter("SELECT * FROM $Sheet1",
ASourceConnection)

ADataAdapter.Fill(MyDataset)

This works Great, however, if a column in the Spreadsheet has a lot of blank
rows before pertinant data is available. The whole column is empty. i.e:

Column1 Column2
Column3
Row1 Tea
..59
Row2 Coffee
..97
........
Row12 Milk 20081002
1.59

All the values work in Column1 and Column3, but Column2 is all blank. If I
put "0" in column2 - Rows 1 - 11 it works, however, I can't modify the
spreadsheet before the query...

This returns all blank entries also: "SELECT Column2 from $Sheet1"

Any Suggestions will be greatly appreciated,

Thanks


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export from Excel to DB2 via ODBC Mauriizo Excel Discussion (Misc queries) 0 January 18th 08 09:39 AM
Excel and ODBC pereyra Excel Programming 3 December 6th 05 12:43 AM
Q:Excel/ODBC/Login .... MSweetG222 Excel Programming 1 July 24th 05 06:37 PM
Excel ODBC Query H. Zhu Excel Programming 1 December 12th 03 03:42 AM
using odbc in excel pmz Excel Programming 1 October 19th 03 10:22 PM


All times are GMT +1. The time now is 11:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"