Environment
General system deployment of the server if the Windows system, the 64-bit WIN2003 structure will be used. However, most of the programs we write are compiled in the x86 32-bit CPU architecture, it is really troublesome to transplant to a 64-bit machine, not only requires the application to be 64-bit schema compilation, but also requires the database to be 64-bit, IIS64-bit, framework64-bit, Fortunately, these support components are available from the respective vendors. I wonder if anyone has ever met a problem like me, there is a need to add an Access database import feature in your application, which requires an MDB driver to connect to ODBC, but Microsoft OLE DB Provider for Jet does not support 64-bit systems. Even after the installation of office2007, it is embarrassing to find that ODBC has not changed any more.
Analysis
The 64-bit system structure is analyzed.
- There are two installation directories under C: Program Files and programs files (x86);
- There are two directories in the Windows folder: System32 and SysWOW64;
There are no other drivers in Odbcad32.exe in System32 (this is also the program that ODBC directly launches in the Control Panel), but all drivers such as MDB exist in Odbcad32.exe under SysWOW64, which indicates that the ODBC driver exists in the operating system only because the operating mode causes A different ODBC program was called, resulting in no corresponding driver being found. With this in mind, you can find a solution: Toggle the 64-bit run mode to 32-bit.
Resolution Step Toggle IIS Run mode to 32-bit
Start → run →cmd, run script: cscript%systemdrive%\inetpub\adminscripts\adsutil.vbs SET w3svc/apppools/enable32bitapponwin64 1, you can switch IIS from 64-bit to 32-bit mode, and if you want to revert to 64-bit mode, run script: cscript%systemdrive%\inetpub\adminscripts\adsutil.vbs SET w3svc/apppools/ Enable32bitAppOnWin64 0. If the pin is wrong, the switch path is C:\Inetpub\AdminScripts, because the Adsutil.vbs file is in the path.
ASP. NET run mode is 32-bit
Re-register ASP. Start → run →cmd, run script:%systemroot%\microsoft.net\framework\v2.0.40607\aspnet_regiis.exe-i. To register 64-bit, the script is:%systemroot%\microsoft.net\framework64\v2.0.40607\aspnet_regiis.exe-i.
By restarting the machine, IIS can run a 32-bit program, and the ODBC connection is also in effect.
Oracle64 bit switching to 32-bit method
If the previous system is running in 64-bit mode using 64-bit Oracle, the database connection to the program after the modification to 32-bit mode fails, it will be reported: "If you install 32-bit Oracle client components in 64-bit mode ..." this error. The way to think of it is to install the 32-bit Oracle client again. In fact, the simplest way is to download the ORALCE Toolkit Instant Client package. Unzip it into any folder, such as D:\oracle\instantclient_11_2.
Set the corresponding environment variable: Right-click My Computer – Properties – Advanced – Environment variables – System environment variables:
1, new nls_lang=simplified Chinese_china. ZHS16GBK (note that there are spaces in the middle, this if not set, Toad query Chinese will be garbled)
2. New or modified Tns_admin=d:\oracle\instantclient_11_2
3. Modify path to increase D:\oracle\instantclient_11_2 and delete the original 64-bit Oracle
The first of these is important to resolve the run times: ora-12705:cannot access NLS data files or invalid environment specified errors.
Create a new text file with a modified suffix named Reg with the content:
Windows Registry Editor Version 5.00
[Hkey_local_machine\software\oracle\key_oraclient10g_home1]
"Nls_lang" = "Simplified Chinese_china. ZHS16GBK "
"Oracle_bundle_name" = "standard"
"Oracle_group_name" = "Oracle–oraclient10g_home1″
"Oracle_home" = "D:\oracle\instantclient_11_2"
"Oracle_home_key" = "Software\\oracle\\key_oraclient10g_home1″
"Oracle_home_name" = "Oraclient10g_home1″
Double-click Import Registry.
Copy the 64-bit Oracle TNS file into D:\oracle\instantclient_11_2 or run the report: Ora-12154:tns:could not resolve the connect identifier Specified error.
After completing the above changes, restart the computer, run the website program, found everything as expected to work!
Win2003 64-bit system ODBC connection use