p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   Pro VB Databases (http://p2p.wrox.com/pro-vb-databases-81/)
-   -   sql (http://p2p.wrox.com/pro-vb-databases/41291-sql.html)

kim April 14th, 2006 01:59 PM

sql
 
i hve a excel file that i want to import to my form to view and change.
can i import it into a database?


SMerrill8 May 4th, 2006 08:44 PM

Connect to it with the following ADO connection string:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
"HDR=Yes;" indicates that the first row contains columnnames, not data
"IMEX=1;" tells the driver to always read "intermixed" data columns as text
TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name followed by a "$" and wrapped in "[" "]" brackets.
It is nice if the data rectangle starts in the upper-left corner of the sheet.

~ Shaun


All times are GMT -4. The time now is 07:23 PM.

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.