XL7: DAO Error Using OpenDatabase on ODBC SourcesID: Q133414
|
In Microsoft Excel, when you attempt to open a database for use with Data Access Objects, you may receive the following error message:
Run Time Error 3423
You cannot use ODBC to attach (link) an external Microsoft Access or ISAM database table to your database.
This error occurs if you are trying to open a database for which an installable ISAM driver exists, and you are using an ODBC data source to establish the connection to that database.
In this situation, you must use the ISAM driver to open the database.
The following two examples demonstrate the syntax for connecting to an
external database using Data Access Objects, using ISAM and ODBC drivers.
Microsoft provides examples of Visual Basic procedures for illustration
only, without warranty either expressed or implied, including but not
limited to the implied warranties of merchantability and/or fitness for a
particular purpose. This Visual Basic procedure is provided 'as is' and
Microsoft does not guarantee that it can be used in all situations.
Microsoft does not support modifications of this procedure to suit customer
requirements for a particular purpose.
Before you run either of the following macros, use the following two steps:
Sub ODBCMethod()
Dim db1 As Database
Set db1 = OpenDatabase("c:\test", False, False, _
"ODBC;DSN=dBASE Files;DBQ=c:\test")
End Sub
ISAM
----
Sub ISAMMethod()
Dim db1 As Database
Set db1 = OpenDatabase("c:\test", False, False, "dBASE IV")
End Sub
When you use data access objects in Microsoft Excel for Windows, it is
possible to access an external database using either an installable ISAM
driver or an ODBC driver. The following are two examples of data base types
that can access an external database using either an installable ISAM
driver or an ODBC driver:
Microsoft Excel files
Text files
Additional query words:
Keywords : kbnetwork xlwin
Version : 7.00
Platform : WINDOWS
Issue type :
Last Reviewed: April 15, 1999