| | | This function is only available if you have the Excel ODBC Add-in (XLODBC.xla) installed. |
| | | This add-in was installed by default with Excel 2000 but is no longer available as a built-in add-in. |
| | | Using this old Excel 7.0 add-in is not recommended as the ADO (ActiveX Data Object) library has since become the preferred method for connecting to external data sources. |
| | | If you are using a more recent version of Excel this add-in can be downloaded from the Microsoft website. |
| | | This add-in will be installed in the following folder: C:\Program Files\Microsoft Office\Office10\Library\Msquery\ |
| | | The "connection_string" must be in the exact format for that particular driver. |
| | | The "connection_string" for dBase might be - DSN=Nwind;PWD=password. |
| | | The "connection_string" for SQL Server might be - DSN=ServerName;Database=People;UID=name;PWD=password. |
| | | The "connection_string" for Oracle might be - DNS=OracleDataSource;DBQ=Name;UID=name;PWD=password. |
| | | The "connection_string" must always contain the DNS (Data Source Name). |
| | | The "connection_string" can be entered as an array. |
| | | If the "connection_string" is longer than 250 characters you must enter it as an array. |
| | | If the "connection_string" is not valid and a connection cannot be made, then #N/A! is returned. |
| | | If "driver_prompt" is left blank, then 2 is used. |
| | | The "query_text" can be made up of cell references. |
| | | If "query_text" is longer than 255 characters then split the query into a group of vertical cells and pass in the cell range. |
| | | If "query_text" is invalid SQL or cannot be executed, then #N/A! is returned. |
| | | If "col_names_logical" is left blank, then False is used. |
| | | If this function is successful it will either return the result as an array or the number of rows affected. |
| | | For more examples please refer to the this Knowledge Base Article (124218). |