Difference between revisions of "Microsoft Access OLE DB"

From database24
Jump to navigation Jump to search
(Created page with '== General == It is possible to access some resources without writing any line of code. All you need is to write a query which makes use of ISAM OLEDB. For further reading: * [h...')
 
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== General ==
 
== General ==
It is possible to access some resources without writing any line of code. All you need is to write a query which makes use of ISAM OLEDB.
+
It is possible to access some resources without writing any line of code.  
 +
All you need is to write a query which makes use of ISAM OLEDB (see the
 +
[http://msdn.microsoft.com/en-us/library/aa164914(office.10).aspx Overview]
 +
provided by Microsoft).
  
For further reading:
+
The ISAM OLEDB type must be put in square brackets and and with a semicolon
* [http://msdn.microsoft.com/en-us/library/aa164914(office.10).aspx Overview]
+
like in this example for an Microsoft Excel workbook:
* [http://ewbi.blogs.com/develops/2006/12/reading_html_ta.html HTML specifica]
 
  
== Microsoft Access ==
+
<syntaxhighlight lang="sql" highlight="3">
<syntaxhighlight lang=vb>
 
 
SELECT *
 
SELECT *
   FROM tblTable
+
   FROM [...]
     IN 'c:\data.mdb'
+
     IN '...'[EXCEL 8.0;];
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Microsoft Excel ==
+
If you need to specify optional parameters they have to be appended to the
 +
ISAM type:
  
=== Worksheet ===
+
<syntaxhighlight lang="sql" highlight="3">
<syntaxhighlight lang=vb>
 
 
SELECT *
 
SELECT *
   FROM [Worksheet$]  
+
   FROM [...]  
     IN 'c:\data.xls'[EXCEL 8.0;];
+
     IN '...'[EXCEL 8.0;HDR=yes;IMEX=0;];
 
</syntaxhighlight>
 
</syntaxhighlight>
  
=== Named Range ===
+
* [[Microsoft Access OLE DB &mdash; Microsoft Access|Microsoft Access]]
<syntaxhighlight lang=vb>
+
* [[Microsoft Access OLE DB &mdash; Microsoft Excel|Microsoft Excel]]
SELECT *
+
* [[Microsoft Access OLE DB &mdash; Text (CSV, TSV, TXT)|CSV, TSV, TXT]]
  FROM [NamedRange]  
+
* [[Microsoft Access OLE DB &mdash; ODBC|ODBC]]
    IN 'c:\data.xls'[EXCEL 8.0;];
+
* [[Microsoft Access OLE DB &mdash; Hypertext Marckup Language (HTML)|HTML]]
</syntaxhighlight>
+
* [[Microsoft Access OLE DB &mdash; Microsoft Outlook|Microsoft Outlook]]
 
 
=== Reference ===
 
<syntaxhighlight lang=vb>
 
SELECT *
 
  FROM [Worksheet$A1:B2]  
 
    IN 'c:\data.xls'[EXCEL 8.0;];
 
</syntaxhighlight>
 
 
 
=== Optional Parameters ===
 
* HDR = yes|no
 
* IMEX = 0|1
 
  
== Text file ==
+
* [[Microsoft Access OLE DB &mdash; Microsoft SharePoint|Microsoft SharePoint]]
<syntaxhighlight lang=vb>
 
SELECT *
 
  FROM data.csv
 
    IN 'c:\'[TEXT;];
 
</syntaxhighlight>
 
  
=== Optional Parameters ===
+
[[Category:Microsoft Access]]
* HDR = yes|no
+
[[Category:SQL]]

Latest revision as of 11:04, 15 November 2016

General

It is possible to access some resources without writing any line of code. All you need is to write a query which makes use of ISAM OLEDB (see the Overview provided by Microsoft).

The ISAM OLEDB type must be put in square brackets and and with a semicolon like in this example for an Microsoft Excel workbook:

SELECT *
  FROM [...] 
    IN '...'[EXCEL 8.0;];

If you need to specify optional parameters they have to be appended to the ISAM type:

SELECT *
  FROM [...] 
    IN '...'[EXCEL 8.0;HDR=yes;IMEX=0;];