A project needs to read data from the Oracle database, during deployment, the system always prompts "requires oracle client software 8.1.7 or later". Finding information from the Internet also means you need to set permissions after installing the Oracle client, however, if a dozens of megabytes of software is attached to a hundreds of megabytes of Oracle client, it is always uncomfortable. I found the Oracle 9i Lite client 12.1 M on the Internet, so I thought that accessing Oracle is nothing more than using some Dll of Oracle and some system environment variables or some key values in the registry. It should be enough to install the Oracle 9i Lite client. After several hours of permission settings, connection string settings, and configuration file settings, the solution is as follows:
1. Install the Oracle 9i Lite client and modify the tnsnames. ora file (default path: C: \ Oracle \ ora90 \ network \ ADMIN). The modification is as follows:
# TNSNAMES. ORA Network Configuration File: C: \ oracle \ ora90 \ network \ admin \ tnsnames. ora
# Generated by Oracle configuration tools.
# Sample
# DATABASENAME =
# (DESCRIPTION =
# (ADDRESS_LIST =
# (ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521 ))
#)
# (CONNECT_DATA =
# (SERVICE_NAME = servicename)
#)
#)
ORACLE = # This name is used in the subsequent connection string
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = iii) (PORT = 1521) # change Red iii to the name or ip address of the Oracle Database Server
)
(CONNECT_DATA =
(SERVICE_NAME = oracle) # change the red oracle Database Name
)
)
ORACLEBCV =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 130.81.100.136) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = scbus)
)
)
REPORT =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 9.83.70.14) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = report)
)
)
Modify the value of the Oracle sub-key NLS_LANG in the registry to be consistent with that on the Oracle Data Server. Otherwise, the queried content is garbled. Restart the machine.
2. Writing the connection string to connect to the Oracle database
<Add name = "DataAccessLibrary. Properties. Settings. ConnectionString"
ConnectionString = "Provider = MSDAORA; Data Source = oracle; Persist Security Info = True; Password = outpadm; User ID = outpadm"
ProviderName = "System. Data. OleDb"/> # the yellow part must be the same as the yellow part in the preceding configuration file.
The problem is solved by successfully accessing the Oracle 10G Database Under win2003 under xp.
Although it took a long time, it seems that the customer's deployment will save nearly 20-30 minutes.