|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to create a table in excel?Hi,
I use this connection string to connect to excel: ConnectionString="Provider = Microsoft.Jet.OLEDB.4.0; Data Source = c:\\excel\mydb.xls; Extended Properties=Excel 8.0;" Doing this, it accesses the table in sheet1: sql = "select field1 from data;", but how to access a table located in the same (mydb.xls) file but in sheet2? Thanks Britt On Thu, 9 Nov 2006 21:56:24 +0100, "Britt" <fbf***@dvsv.qs> wrote: ¤ Hi,¤ ¤ I use this connection string to connect to excel: ¤ ¤ ConnectionString="Provider = Microsoft.Jet.OLEDB.4.0; Data Source = ¤ c:\\excel\mydb.xls; Extended Properties=Excel 8.0;" ¤ ¤ Doing this, it accesses the table in sheet1: sql = "select field1 from ¤ data;", but how to access a table located in the same (mydb.xls) file but ¤ in sheet2? In Excel the Worksheet name is the table name. You simply specify it in your SELECT statement: SELECT * FROM SHEET2$ Paul ~~~~ Microsoft MVP (Visual Basic) |
|||||||||||||||||||||||