LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Using SQL command to access Excel

I am using the following SQL command in C# to fill a table from an Excel file.

string strSQL = "Select * FROM [Sheet1$F:G]";
daExcel = new System.Data.OleDb.OleDbDataAdapter(strSQL, urlconn);
table = new DataTable();
int ret = daExcel.Fill(table);

This works fine but I can't figure out how to use the WHERE statement for
selective processing. For example, if I use "Select * FROM [Sheet1$F:G]
WHERE [Sheet1$F] ' '", if get an error saying that there is a missing
value. Does anyone know how to use a WHERE statement when accessing an Excel
file?
 
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
Access command from Excel JT Excel Programming 1 November 19th 08 02:48 PM
Printing Access reports through Excel command button? Ed Excel Discussion (Misc queries) 0 June 7th 06 03:52 PM
Open Access DB in Excel with Command Button Darrell[_4_] Excel Programming 1 December 13th 03 01:28 AM
Open Access DB in Excel with Command Button onedaywhen Excel Programming 0 December 12th 03 10:19 AM
Open Access DB in Excel with Command Button Bill Manville Excel Programming 0 December 12th 03 08:11 AM


All times are GMT +1. The time now is 10:20 PM.

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

About Us

"It's about Microsoft Excel"