HOWTO: Rename the Jet 3.51 ODBC Drivers under Windows 2000

ID: Q247440


The information in this article applies to:
  • Microsoft Windows 2000
  • Microsoft Visual Basic Professional and Enterprise Editions for Windows, versions 5.0, 6.0
  • Microsoft Open Database Connectivity, version 3.51


SUMMARY

Microsoft Windows 2000 comes with MDAC 2.5 preinstalled. The ODBC driver for Microsoft Access 4.0 in MDAC 2.5 provides additional functionality over the 3.51 versions of the driver, but some other previous functionality has been removed. Existing applications that use the ODBC driver for Microsoft Access automatically use the new drivers. Applications can fail if they require functionality that the new ODBC drivers do not provide.

This article provides a method to install the Jet 3.51 ODBC drivers on your Microsoft Windows 2000 computer and then rename the drivers so your applications see them as being distinct from the drivers that use Jet 4.0.


MORE INFORMATION

WARNING: Microsoft provides this article 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 article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures.

The steps described should only be used if you are an experienced programmer. Modification to the Windows Registry may cause some applications or the operating system to change behavior or stop working. Make a back-up of the registry before attempting any modifications.

Upgrading your Microsoft Access ODBC driver from version 3.5 to version 4.0 provides your applications a number of benefits, including the ability to read and write Jet 4.0 format MDB files. However, if your application uses the IISAM drivers, some functionality is lost, which could result in your application not working.

The lost functionality includes dropping the FoxPro IISAM and making the dBase and Paradox IISAM drivers give read-only access to your files.

For new application development, there are several possible workarounds:

  • Use the FoxPro ODBC driver. It provides more functionality than the IISAM driver, although you cannot use the Seek method.


  • The dBase and Paradox IISAMs do allow updating files if the Borland Database Engine (BDE) is installed. However, this must be licensed from Inprise.


  • Use the steps outlined in this article to install the Jet 3.51 ODBC and Jet 4 ODBC drivers simultaneously on your Microsoft Windows 2000 computer.

    NOTE: This last alternative only works if using Windows 2000 and does not work if using Windows NT 4.0 or Windows 95 or 98.


Setting Up the Jet 3.5 ODBC Drivers

The steps described below allow your ODBC applications that use Jet 3.5 and Jet 4.0 to co-exist and run simultaneously on a Windows 2000 computer. It is assumed that Jet 3.5 and Jet 4.0 are both installed on the computer and the ODBC driver is currently version 4.0.

If you need to get Jet 3.5 on the computer, you can install any DAO 3.5 application that uses the appropriate IISAM drivers, or you can copy and register the files outlined in the following Knowledge Base articles:
Q240377 HOWTO: Insuring Jet 3.5 Is Installed Correctly
Applications that use the Jet 3.5 ODBC drivers have to use a different DSN or connect string than ones that use the default Microsoft Access (Jet 4.0) ODBC driver.

The ODBC drivers on your system are defined by Registry keys under:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC
This article provides the following:
  • A list of files to copy to your Windows 2000 computers.


  • A program to build some links to enable the ODBC drivers to function correctly outside the system and application directories.


  • A file to register them with a new driver name. In this case, the driver names have the words "Jet 351" inserted into them.


Copying the Files

  1. Locate the following files on your Visual Basic 5.0 or Visual Basic 6.0 (pre-SP3) CD. They are in the folder \OS\System on CD 1 of the Visual Studio 98 CDs. For example:


  2. ODBCJT32.DLL
    ODBCJI32.DLL
    ODBCTL32.DLL
    ODDBSE32.DLL
    ODEXL32.DLL
    ODFOX32.DLL
    ODPDX32.DLL
    ODTEXT32.DLL
  3. Copy the files to a directory, such as C:\JET351ODBC, on your Windows 2000 computer. The directory must be on the same drive as your Windows 2000 installation. If it is on a different drive, the system links do not build correctly in the next step.


Making System Links

The ODBC driver looks in the directory where it is located for certain system files. However, you cannot just copy these files into the directory if it is different than the application directory because the files might conflict with ones of the same name that are loaded by the host application.

Windows 2000 introduces the concept of Hard Links, which allow you to create a file in the application directory that points to a file in another directory. This is different than the .lnk files used to redirect applications. The hard link ensures that only one copy of the DLL is loaded into the process space.

The following Visual Basic code demonstrates how to create the links required by the ODBC driver:
  1. In Visual Basic, create a new Standard EXE. Form1 is created by default.


  2. On the Project menu, select Add Module, then add a code module. Module1 is created by default.


  3. From the Project menu, select Project1 Properties. From the Startup Object drop-down list, select Sub Main. Click OK.


  4. Paste the following code into the General Declarations section of Module1:


  5. 
    Option Explicit
    
    Private Declare Function CreateHardLink Lib "KERNEL32" Alias "CreateHardLinkA" _
           (ByVal LinkPath As String, _
            ByVal FilePath As String, _
            ByVal Security As Long) As Long
    
    Private Const SysDir As String = "c:\winnt\system32\"
    Private Const ODBCDir As String = "c:\jet351odbc\"
    
    Sub Main()
      CreateLink "OLE32.DLL"
      CreateLink "MSJTER35.DLL"
      CreateLink "VBAJET32.DLL"
      CreateLink "EXPSRV.DLL"
    End Sub
    
    Private Sub CreateLink(FileName As String)
    Dim Result As Long
      Result = CreateHardLink(ODBCDir & FileName, SysDir & FileName, 0)
      If Result = 0 Then
        Debug.Print "Create Hard link failed on file " & FileName & " with error " & Err.LastDllError
      End If
    End Sub 
  6. If necessary, change the directory names and drive letters to match your particular computer.


  7. Run the Visual Basic project. You only need to run this code one time to permanently create the links.


Creating the Registry File

The following steps enter the Jet ODBC 3.51 file locations into the Windows Registry:
  1. Use the Windows Notepad applet to create a new Text document.


  2. Copy the following entries and paste them into the new Text document:


  3. 
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Jet 351 Access Driver (*.mdb)]
    "UsageCount"=dword:0000000c
    "Driver"="C:\\Jet351ODBC\\odbcjt32.dll"
    "Setup"="C:\\Jet351ODBC\\odbcjt32.dll"
    "APILevel"="1"
    "ConnectFunctions"="YYN"
    "DriverODBCVer"="02.50"
    "FileUsage"="2"
    "FileExtns"="*.mdb"
    "SQLLevel"="0"
    "s"="YYN"
    "CPTimeout"="60"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Jet 351 dBase Driver (*.dbf)]
    "UsageCount"=dword:0000000b
    "Driver"="C:\\Jet351ODBC\\odbcjt32.dll"
    "Setup"="C:\\Jet351ODBC\\oddbse32.dll"
    "APILevel"="1"
    "ConnectFunctions"="YYN"
    "DriverODBCVer"="02.50"
    "FileUsage"="1"
    "FileExtns"="*.dbf,*.ndx,*.mdx"
    "SQLLevel"="0"
    "cg"=""
    ""=""
    "CPTimeout"="<not pooled>"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Jet 351 Excel Driver (*.xls)]
    "UsageCount"=dword:00000009
    "Driver"="C:\\Jet351ODBC\\odbcjt32.dll"
    "Setup"="C:\\Jet351ODBC\\odexl32.dll"
    "APILevel"="1"
    "ConnectFunctions"="YYN"
    "DriverODBCVer"="02.50"
    "FileUsage"="1"
    "FileExtns"="*.xls"
    "SQLLevel"="0"
    "CPTimeout"="<not pooled>"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Jet 351 FoxPro Driver (*.dbf)]
    "UsageCount"=dword:00000008
    "Driver"="C:\\Jet351ODBC\\odbcjt32.dll"
    "Setup"="C:\\Jet351ODBC\\odfox32.dll"
    "APILevel"="1"
    "ConnectFunctions"="YYN"
    "DriverODBCVer"="02.50"
    "FileUsage"="1"
    "FileExtns"="*.dbf,*.cdx,*.idx,*.ftp"
    "SQLLevel"="0"
    "CPTimeout"="<not pooled>"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Jet 351 Paradox Driver (*.db )]
    "UsageCount"=dword:00000009
    "Driver"="C:\\Jet351ODBC\\odbcjt32.dll"
    "Setup"="C:\\Jet351ODBC\\odpdx32.dll"
    "APILevel"="1"
    "ConnectFunctions"="YYN"
    "DriverODBCVer"="02.50"
    "FileUsage"="1"
    "FileExtns"="*.db"
    "SQLLevel"="0"
    "CPTimeout"="<not pooled>"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Jet 351 Text Driver (*.txt; *.csv)]
    "UsageCount"=dword:0000000a
    "Driver"="C:\\Jet351ODBC\\odbcjt32.dll"
    "Setup"="C:\\Jet351ODBC\\odtext32.dll"
    "APILevel"="1"
    "ConnectFunctions"="YYN"
    "DriverODBCVer"="02.50"
    "FileUsage"="1"
    "FileExtns"="*.,*.asc,*.csv,*.tab,*.txt,*.csv"
    "SQLLevel"="0"
    "CPTimeout"="<not pooled>"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
    "Microsoft Jet 351 Access Driver (*.mdb)"="Installed"
    "Microsoft Jet 351 dBase Driver (*.dbf)"="Installed"
    "Microsoft Jet 351 Excel Driver (*.xls)"="Installed"
    "Microsoft Jet 351 FoxPro Driver (*.dbf)"="Installed"
    "Microsoft Jet 351 Text Driver (*.txt; *.csv)"="Installed"
    "Microsoft Jet 351 Paradox Driver (*.db )"="Installed" 
  4. If necessary, change the directory names and drive letters to match the ones on your system.


  5. Save to a file with a .reg extension, such as Jet351ODBC.reg.


Merging the Registry File

There are several ways to merge the newly created REG file into the Windows NT Registry:
  • Double-click on the file.


  • Alternate-click on the file and choose Merge.


  • Use the Windows REGEDIT program.


  • Note that you only need to merge the REG file once to permanently enter the information into the Registry.
To merge the file using the Windows REGEDIT program:
  1. On the Windows 2000 Start menu, choose Run.


  2. In the Open: text box, type:


  3. C:\WinNT\RegEdit.exe

  4. On the Registry menu, choose Import Registry File. Browse to the newly created .reg file, select it, then click Open. A message box appears that displays the .reg file information that was entered into the registry.


Using the Drivers

Once you have created the hard links and entered the information into the registry, you can use the ODBC Driver Manager to create DSNs with the renamed driver. You can also use DSN-less connections in your application by referencing the renamed driver. The driver names are:
Microsoft Jet 351 Access Driver (*.mdb)
Microsoft Jet 351 dBase Driver (*.dbf)
Microsoft Jet 351 Excel Driver (*.xls)
Microsoft Jet 351 FoxPro Driver (*.dbf)
Microsoft Jet 351 Text Driver (*.txt; *.csv)
Microsoft Jet 351 Paradox Driver (*.db )
You can compile the application and use it on any other Windows 2000 computer that has the necessary links and registry information. If you are going to redistribute the application to a Windows 2000 computer that has not had the changes made, you have to create a patch program to perform the three steps described above, including detecting the drive and directory that the operating system is installed on and dynamically using this data to point to the correct directories.

© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Malcolm Stewart, Microsoft Corporation


REFERENCES

Microsoft Developer Network topic: CreateHardLink

Additional query words: Installable ISAM

Keywords : kbDatabase kbDBase kbDriver kbJET kbWinOS2000 kbODBC kbVBp kbVFp kbXBase kbGrpVBDB kbGrpMDAC kbDSupport kbMDAC250
Version : WINDOWS:3.51,5.0,6.0
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: January 17, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.