Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QUERYING FROM EXCEL AS THE DATASOURCE

Status
Not open for further replies.

kingjjx

Programmer
Sep 18, 2001
181
0
0
US
Hi, how can you use Excel as the datasource and query from it ?

thanks
-jon
 
Create an ODBC datasource the same way you created one for your database. But, use the ODBC driver for Excel. It comes with WinNT and Win2000.
 
how do you actually query from it though ?
how do i write the select statements ?

 
The only way you can ever query an ODBC datasource. Use SQL. Think of the columns in the spreadsheet as fields and the rows as records. I don't know if it will work if you have more than one worksheet in the file, you will have to research this. You might try specifying the worksheet the same way that you do in Excel macros. Try or msdn.microsoft.com for more info.
 
or maybe output it to a csv file and import it into access.. i did that the other day and it worked ok
 
Hmmm...

CFComet seemed to mention that you could use the name of the worksheet for the table name...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top