Home > Uncategorized > Using OleDb with Excel

Using OleDb with Excel

Being an advocate of OleDb, I thought I’d share some information I learnt tonight regarding connecting to Excel spreadsheets using OleDb. Using a DSN such  as Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<filename>;&Extended Properties="Excel 8.0;" you get access to the spreadsheet "tables" as if it was an access database.

A few points I noticed. was that sheets are named [sheet1$], column headers may not always be named, so you may need to resort to using ordinals in your recordset. Also, when doing "LIKE" clauses in sql, you use the % syntax, not the * syntax, as common with MS Access.


Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: