The method is as follows: (Environment: Vs2008 + Oracle10g)
1. Extract the files in instantclient-basic-win32-10.2.0.4.zip to the specified location (I decompress the files to D: \ fox and name them instantclient)
The content should include nine files: BASIC_README, oci. dll, ocijdbc10.dll, ociw32.dll, orannzsbb10.dll, oraocci10.dll, oraociei10.dll, classes12.jar, and ojdbc14.jar.
(Note: accept)
2. Add the tnsnames. ora file (to the D: \ fox \ instantclient file ):
The content of the tnsnames. ora file:
# Tnsnames. ora Network Configuration File: D: \ fox \ instantclient \ tnsnames. ora/* This is the File address */
# Generated by Oracle configuration tools.
ORCL1 =/* This is the service name of the local Oracle server, which is used in the Code */
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = server address ip address or server name) (PORT = server PORT number, "1521" by default)
)
(CONNECT_DATA =
(SERVICE_NAME = Name of the server database service. Default Value: "orcl")
)
)
3. Add the Registry content: (the content is as follows. Change the file location as needed)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session Manager \ Environment]
"LD_LIBRARY_PATH" = "D :\\ fox \ instantclient"
"TNS_ADMIN" = "D :\\ fox \ instantclient"
"NLS_LANG" = "AMERICAN_AMERICA.ZHS16GBK"
4. Add Environment Variables
Right-click "my computer"> "properties"> "advanced"> "environment variables"> "system variables"> select "Path"> "edit" --> Add "after" variable value "original data "; d: \ fox \ instantclient"
5. restart the computer.
This article from the CSDN blog, reproduced from: http://blog.csdn.net/lhg0302/archive/2009/04/11/4062569.aspx