Just the project at hand solves the problem of ADO connecting to Oracle database and records it to prevent forgetting.
Project situation: Using 32-bit environment to complete the algorithm dynamic library, the results later need to upgrade to 64-bit environment, by the 64-bit software to call, then the 64-bit set up the algorithm dynamic library, found that the database connection failed. The database uses ORACLE10, and the connection technology uses the more familiar ADO.
1. The first suspect is the Msado15.dll version problem referenced by ADO precompilation, and 64-bit msado15.dll were found to reproduce the problem.
2. Suspect that the connection statement relies on the \network\admin\tnsnames.ora file is not correct, so write dead IP and port in the program, still reproduce the problem.
While busy with other projects, only use 32-bit instead of running, knock it down. As a result, 64 people were found to run smoothly on computers with two colleagues, but there were problems on some computers. So determine the problem for the system environment and eventually locate the ODAC.
The problem was finally resolved, but it was still not completely out of the configuration
1. The connection statement is written like this to avoid relying on the Tnsnames.ora file
PROVIDER=ORAOLEDB.ORACLE.1; password= password; Persist Security info=true; User id= username; \
Data Source=\ "(DESCRIPTION = (Address_list = (ADDRESS = (PROTOCOL = TCP) (HOST = IP) (PORT = 1521))) (Connect_data = (SID = data (library))) \ "
It can be the user name, password, database ID, IP, port these proposed to write the configuration file, easy to change.
2. Install the http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html of the corresponding odac,64 bit. Relatively speaking, the 32-bit ODAC is EXE installation files, simple and rough, directly installed everything, so there was no problem. The 64-bit ODAC driver is an xcopy version officially provided by Oracle, and the installation process is referenced by Microsoft's official HTTP://SUPPORT2.MICROSOFT.COM/KB/2831123/ZH-TW.
(1) Decompression xcopy
(2) Use the command line CD to the (1) directory
(3) The command line runs the Install.bat file: Install.bat all c:\oracle\ODAC_64 ODAC
(4) C disk appears directory c:\oracle\ODAC_64, the system environment configuration: Path inside add C:\oracle\ODAC_64 and C:\oracle\ODAC_64\bin
(5) Complete
Finally, this configuration on a machine has an error problem, found that the machine installed on too many things, PATH environment confusion, Oracle version pointing unknown, so will C:\oracle\ODAC_64 and C:\oracle\ODAC_64\ Bin this path is placed at the front of the path property.
64-bit program to connect to Oracle database with ADO