In the project of the Security Supervision Bureau, the Internet website needs to display the enterprise declaration result. The website is developed by another company and the database is Oracle. We originally wanted to open an account to allow them to access our database, but people do not want. Later, after being determined by the information center, they opened the database. We created tables with the same structure in their Oracle database and then wrote data to the table.
At the beginning, we thought about connecting the Oracle database to the server and passed it on my local 32-bit sqlserver, but it was useless on the server (64, finally, I had to give up this method, but I still couldn't find the reason. Later I wanted to write a Windows program to allow the program to retrieve data from the 64-bit database, and then connect to the Oracle database by creating a data source, after the data source is created, the test can be performed on both the local server and the 64-bit server, but the program reports an error after obtaining the 64-bit server, saying that the driver name and default data source are not specified. Then, I tried it for a long time, change project properties-generate-target platform from any CPU to x86.
Attached tnsname. ora:
Jiarui2 =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = 10.10.30.12) (Port = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
The driver used to create the data source is Oracle in orahome90, And the TNS service name is set
Jiarui2, set the account and password to guide, and the data source name to dsn_jiarui. odbcconnection, odbcdataadapter, and odbccommand are used in the program. The database connection string is:
DSN = dsn_jiarui; uid = guide; Pwd = guide; others are the same as accessing SQL Server.