Login Register Actian.com  

Actian Community Wiki

Navigation
Learn About
Developing With
Ingres Talk
Information
Toolbox

ODBC on 64 - Bit Windows

From Ingres Community Wiki

Jump to: navigation, search

Contents

Introduction

Ingres 9.3 and earlier does not support 64-bit Windows directly, including the Ingres ODBC driver. However, since Windows allows 32-bit images to execute in a 64-bit environment, you can still use the Ingres ODBC driver, even if your environment is 64-bit. This article provides some tips on getting started in a 64-bit Windows environment.

Note: Beginning with Ingres 10, there is a 64-bit Windows Ingres release, including the Ingres ODBC driver.

The WOW (Windows on Windows) emulator

The earliest versions of DOS and Windows used a 16-bit addressing scheme. While this was perfectly adequate for the limited memory capabilities of the computers of that time, this technology was soon eclipsed by 32-bit architecture, which greatly expanded the memory capabilities of Windows. In order for 16-bit images and DLL's (Dynamic Link Libraries) to be compatible with a 32-bit environment, Windows deployed a scheme called "thunking". If a 16-bit image was detected, the 16-bit memory references and data were automatically mapped to 32-bit counterparts. This was performed seamlessly.

64-bit architecture is a natural progression of 32-bit, but it is not always possible, in current 64-bit Windows architectures, to enable thunking to 32-bit without a performance penalty. Thus, 64-bit images are executed unilaterally by default.

Since many applications and DLL's are available only as 32-bit images, 64-bit Windows provides a WOW emulator to enable thunking from 64-bit applications to 32-bit applications and DLL's.

Directory structure

64-bit Windows system images reside in %systemroot%\system32. It may seem counter-intuitive to retain the "system32" syntax, but presumably so many applications and scripts rely on this syntax that it was tought best to retain the syntax.

The 32-bit system images reside in %systemroot%\sysWOW64. Note that "%systemroot%" typically resolves to c:\WINDOWS.

File naming

The applications and DLL's in the sysWOW64 directory are named the same as their counterparts in 32-bit Windows platforms. The primary difference is that these images can be executed in a 64-bit environment.

The applications and DLL's in the system32 directory may retain the "xxxx32.EXE" and "xxxx32.DLL" syntax, but are actually 64-bit images. In fact, few images contain the "64" nomenclature except for WOW64 images. Thus, 64-bit Windows directories contain a great many files with identical names, but with different architecture.

Enabling the WOW emulator

Here are some alternatives to enable 64-bit WOW emulation:

  1. Execute the application from the %systemroot%\sysWOW64 directory.
  2. Reference the entire path of the application. For example, execution of "%systemroot%\sysWOW64\write.exe" executes the 32-bit version of the write utility regardless of the current directory.
  3. Change the PATH environment variable to search %systemroot%\sysWOW64 before searching other system directories. One may do this from the command prompt window, which sets PATH at the user level, or from "My Computer->Properties->Advanced->Environment Variables", which allows you to set the default system value for PATH.

The ODBC Driver Manager Library

The ODBC driver manager is named ODBC32.DLL, and resides in both the system32 and sysWOW64 directory. ODBC applications are designed to link with ODBC32.DLL, which then loads individual ODBC driver DLL's when an application makes its first connection to the target database. An ODBC application will reference the first ODBC32.DLL it finds in the PATH definition. If an application wish to use a 32-bit ODBC driver, such as the Ingres ODBC driver, the sysWOW64 directory must be referenced first. Otherwise, the ODBC application becomes uniformly 64-bit and will have no knowlege of the Ingres ODBC Driver.

The ODBC Administrator

The default ODBC Administrator, available via the "Data Sources (ODBC)" in control panel or from the image %system_root%\system32\odbcad32.exe, is a 64-bit image, and has no knowledge of 32-bit ODBC drivers. Instead, one must invoke the image %system_root%\sysWOW64\odbcad32.exe. The notation %system_root% refers to the drive that contains the system software for Windows. Typically, this is C:\Windows. Click on the Command Prompt window from your desk top to bring up the 32-bit version of the ODBC Administrator, as shown below:

Image:odbc64_1.jpg

To verify that the 32-bit version of the ODBC Administrator is in use, click on the "Drivers" tab and verify that Ingres drivers are listed:

Image:odbc64_2.jpg

If you wish to use the Ingres ODBC driver with SQL Server, click on the System DSN tab to define your ODBC DSN definition. User DSN definitions will not be available to SQL Server utilities. Otherwise, you may create user or file DSN definitions as required. See How to Create an Ingres ODBC Data Source Definition (Windows) for details. You may now build or execute 32-bit ODBC applications using the DSN definition you created to connect to the Ingres database.

64-bit SQL Server Considerations

To import data into SQL Server 2008 from Ingres, the 32-bit version of the SQL Server Import and Export Data Utility must be used. On SQL Server 2005, this is called the DTS (Data Transformation Service) utility. The Import and Export Data Utility is accessible from Start->All Programs->SQL Server 2008 as shown below:

Image:odbc64_3.jpg

When the 32-bit SQL Server Import and Export Data utility is selected, a welcome page appears for the SQL Server Import and Export Wizard. Click the scroll button on the far right of the Data source window and scroll to the .Net Framework Data Provider for ODBC:

Image:odbc64_4.jpg

Note that the Ingres .Net Data Provider may also be selected.

If you see no reference to the .Net Framework Provider for ODBC, this is available as a free download from http://www.microsoft.com/downloads. Search for "ODBC .Net Data Provider" to download and install the .Net Framework Provider for ODBC.

After selecting the provider, click <Next>. The Choose a Data Source window appears. The ODBC DSN definitions you have defined in the ODBC Administrator will not be visible. Enter the name of an ODBC system definition and a driver name of Ingres, as shown below:

Image:odbc64_5.jpg

Click <Next>. The Choose a Destination window appears:

Image:odbc64_6.jpg

Enter alternate information as required, or retain the defaults. The Server Name is the required minimum entry. Click <Next>. The Specify Table Copy or Query page appears. Select "Copy data from one or more tables or views" to import from Ingres using default values:

Image:odbc64_8.jpg

Click <Next>. The Select Tables and Views page appears. Click on the Ingres table you wish to import, and edit the destination name as required:

Image:odbc64_9.jpg

The Convert Types Without Error Checking page appears. You may ignore any warning. Click <Next> to continue.

The Save and Run Package page appears. Click on the <Finish> button:

Image:odbc64_10.jpg

The Complete the Wizard page appears. Click the <Finish> button. A status page appears indicating the progress of the import and any errors that may have occurred during the data transfer:

Image:odbc64_11.jpg

If the status page indicates success, the Ingres data has been successfully imported into the SQL Server database.

Personal tools
© 2011 Actian Corporation. All Rights Reserved